From: Kurt Zeilenga Date: Tue, 15 Mar 2005 03:11:24 +0000 (+0000) Subject: cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~67 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f06ca8eb1fe740cd2e2a353b5fe293e3df0359b9;p=openldap cleanup --- diff --git a/libraries/liblutil/getpeereid.c b/libraries/liblutil/getpeereid.c index 0b054a2b95..258e7c5de9 100644 --- a/libraries/liblutil/getpeereid.c +++ b/libraries/liblutil/getpeereid.c @@ -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 */ diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 3438fe1df6..eebc46c6f5 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -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); diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 127ac5a45b..9909b2dc76 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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