]> git.sur5r.net Git - openldap/commitdiff
cleanup
authorKurt Zeilenga <kurt@openldap.org>
Tue, 15 Mar 2005 03:11:24 +0000 (03:11 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 15 Mar 2005 03:11:24 +0000 (03:11 +0000)
libraries/liblutil/getpeereid.c
servers/slapd/daemon.c
servers/slapd/slap.h

index 0b054a2b95c1e18b231529969da81b44ffa2e231..258e7c5de9e9dc6eadc86eac5623b98d5d16fda9 100644 (file)
@@ -99,38 +99,36 @@ int getpeereid( int s, uid_t *euid, gid_t *egid )
                }
        }
 #elif defined(SOCKCREDSIZE)
-        struct msghdr msg;
-        socklen_t crmsgsize;
-        void *crmsg;
-        struct cmsghdr *cmp;
-        struct sockcred *sc;
+       struct msghdr msg;
+       socklen_t crmsgsize;
+       void *crmsg;
+       struct cmsghdr *cmp;
+       struct sockcred *sc;
 
        memset(&msg, 0, sizeof msg);
        crmsgsize = CMSG_SPACE(SOCKCREDSIZE(NGROUPS));
-       if (crmsgsize == 0)
-           goto sc_err;
+       if (crmsgsize == 0) goto sc_err;
        crmsg = malloc(crmsgsize);
-       if (crmsg == NULL)
-           goto sc_err;
+       if (crmsg == NULL) goto sc_err;
        memset(crmsg, 0, crmsgsize);
        
        msg.msg_control = crmsg;
        msg.msg_controllen = crmsgsize;
        
        if (recvmsg(s, &msg, 0) < 0) {
-           free(crmsg);
-           goto sc_err;
+               free(crmsg);
+               goto sc_err;
        }       
 
        if (msg.msg_controllen == 0 || (msg.msg_flags & MSG_CTRUNC) != 0) {
-           free(crmsg);
-           goto sc_err;
+               free(crmsg);
+               goto sc_err;
        }       
        
        cmp = CMSG_FIRSTHDR(&msg);
        if (cmp->cmsg_level != SOL_SOCKET || cmp->cmsg_type != SCM_CREDS) {
-           printf("nocreds\n");
-           goto sc_err;
+               printf("nocreds\n");
+               goto sc_err;
        }       
        
        sc = (struct sockcred *)(void *)CMSG_DATA(cmp);
@@ -140,7 +138,8 @@ int getpeereid( int s, uid_t *euid, gid_t *egid )
 
        free(crmsg);
        return 0;
- sc_err:       
+
+sc_err:        
 #endif
 #endif /* LDAP_PF_LOCAL */
 
index 3438fe1df67769851993e3710a041b01193358ef..eebc46c6f55a0cad64b8df1c1370ab3ff3847d1f 100644 (file)
@@ -980,8 +980,8 @@ static int slap_open_listener(
                case AF_LOCAL:
 #ifdef LOCAL_CREDS
                {
-                   int one = 1;
-                   setsockopt(l.sl_sd, 0, LOCAL_CREDS, &one, sizeof one);
+                       int one = 1;
+                       setsockopt(l.sl_sd, 0, LOCAL_CREDS, &one, sizeof one);
                }
 #endif
                addrlen = sizeof(struct sockaddr_un);
index 127ac5a45ba417c25e489f4cfa14a8b0ab794663..9909b2dc76ce7628a63d8ad8d1a07ff500b4e79b 100644 (file)
@@ -66,12 +66,12 @@ LDAP_BEGIN_DECL
 #define LDAP_SYNC_TIMESTAMP
 #define LDAP_COLLECTIVE_ATTRIBUTES
 #define SLAP_CONTROL_X_TREE_DELETE LDAP_CONTROL_X_TREE_DELETE
+
+#ifdef ENABLE_REWRITE
+#define SLAP_AUTH_REWRITE      1 /* use librewrite for sasl-regexp */
+#endif
 #endif
 
-#if defined(LDAP_DEVEL) && defined(ENABLE_REWRITE)
-/* use librewrite for sasl-regexp */
-#define SLAP_AUTH_REWRITE      1
-#endif /* LDAP_DEVEL && ENABLE_REWRITE */
 
 /*
  * SLAPD Memory allocation macros