mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Include <ac/unistd.h> not <sys/types.h> and <unistd.h>
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)
This commit is contained in:
parent
5b87c4c448
commit
840e7f2c5c
@ -22,8 +22,7 @@
|
||||
#include <ac/string.h>
|
||||
#include <ac/time.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <ac/unistd.h>
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user