From 840e7f2c5c6de371a68087c566b7cba6204686af Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 7 Dec 2002 18:32:40 +0000 Subject: [PATCH] Include not and Use sizeof( string ) to determine buffer size Put authzDN in same for as used on server (We could, just as well, set authid to "fubar" as it matters not what it is set to) --- libraries/libldap/open.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index dc69578148..9be52bae64 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -22,8 +22,7 @@ #include #include -#include -#include +#include #include "ldap-int.h" #include "ldap_log.h" @@ -361,8 +360,11 @@ ldap_int_open_connection( * yet anyway. */ if( proto == LDAP_PROTO_IPC ) { - char authid[64]; - sprintf( authid, "uid=%d+gid=%d", geteuid(), getegid() ); + char authid[sizeof("uidNumber=XXXXXX,gidNumber=XXXXXX," + "cn=peercred,cn=external,cn=auth")]; + sprintf( authid, "uidNumber=%d,gidNumber=%d," + "cn=peercred,cn=external,cn=auth", + geteuid(), getegid() ); ldap_int_sasl_external( ld, conn, authid, sasl_ssf ); } #endif -- 2.39.5