mrc0mmand / rpms / openldap

Forked from rpms/openldap 3 years ago
Clone

Blame SOURCES/openldap-userconfig-setgid.patch

adf540
Normally, skips reading of user configuration file when running with different effective UID.
adf540
This patch adds the same behavior for GID.
adf540
adf540
Author: Nalin Dahyabhai <nalin@redhat.com>
adf540
adf540
diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c
adf540
index e6b17b4..fbf4829 100644
adf540
--- a/libraries/libldap/init.c
adf540
+++ b/libraries/libldap/init.c
adf540
@@ -678,7 +678,7 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
adf540
 	openldap_ldap_init_w_sysconf(LDAP_CONF_FILE);
adf540
 
adf540
 #ifdef HAVE_GETEUID
adf540
-	if ( geteuid() != getuid() )
adf540
+	if ( geteuid() != getuid() || getegid() != getgid() )
adf540
 		return;
adf540
 #endif
adf540