]> git.sur5r.net Git - openldap/commitdiff
hardcode normalized instead of funky DN form
authorPierangelo Masarati <ando@openldap.org>
Wed, 29 Jun 2005 12:37:28 +0000 (12:37 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 29 Jun 2005 12:37:28 +0000 (12:37 +0000)
servers/slapd/daemon.c

index 2797e85ecfc74dc530c1be9179c03012676d99d0..3b93244c3723eab5e42beb7c1c389fb67cceaeda 100644 (file)
@@ -1372,12 +1372,15 @@ slapd_handle_listener(
 
                        if( getpeereid( s, &uid, &gid ) == 0 ) {
                                authid.bv_val = ch_malloc(
-                                       sizeof("uidnumber=4294967295+gidnumber=4294967295,"
-                                       "cn=peercred,cn=external,cn=auth"));
+                                       STRLENOF( "gidNumber=4294967295+uidNumber=4294967295,"
+                                       "cn=peercred,cn=external,cn=auth" ) + 1 );
                                authid.bv_len = sprintf( authid.bv_val,
-                                       "uidnumber=%d+gidnumber=%d,"
+                                       "gidNumber=%d+uidNumber=%d,"
                                        "cn=peercred,cn=external,cn=auth",
-                                       (int) uid, (int) gid);
+                                       (int) gid, (int) uid );
+                               assert( authid.bv_len <=
+                                       STRLENOF( "gidNumber=4294967295+uidNumber=4294967295,"
+                                       "cn=peercred,cn=external,cn=auth" ) );
                        }
                }
                dnsname = "local";