cpu/cpu-1.4.3-fix-cn.patch

27 lines
1.2 KiB
Diff
Raw Normal View History

diff -up cpu-1.4.3/src/plugins/ldap/ld.c.fix-cn cpu-1.4.3/src/plugins/ldap/ld.c
--- cpu-1.4.3/src/plugins/ldap/ld.c.fix-cn 2010-11-05 11:36:45.000000000 -0600
+++ cpu-1.4.3/src/plugins/ldap/ld.c 2010-11-05 11:40:11.000000000 -0600
@@ -437,7 +437,9 @@ ldapGetCn (void)
size_t slen = 0;
char *temp;
- if (globalLdap->first_name && globalLdap->last_name)
+ if (globalLdap->passent->pw_gecos)
+ temp = globalLdap->passent->pw_gecos;
+ else if (globalLdap->first_name && globalLdap->last_name)
{
slen =
strlen (globalLdap->first_name) + strlen (globalLdap->last_name) + 2;
diff -up cpu-1.4.3/src/plugins/ldap/user.c.fix-cn cpu-1.4.3/src/plugins/ldap/user.c
--- cpu-1.4.3/src/plugins/ldap/user.c.fix-cn 2004-01-10 19:12:37.000000000 -0700
+++ cpu-1.4.3/src/plugins/ldap/user.c 2010-11-05 11:46:48.000000000 -0600
@@ -256,6 +256,8 @@ ldapUserCheck (int mod_op, LDAP * ld)
ldapBuildList (op, "objectClass", globalLdap->user_object_class,
userMod);
}
+ else if (globalLdap->passent->pw_gecos || (globalLdap->first_name && globalLdap->last_name))
+ userMod = ldapBuildListStr (op, "cn", ldapGetCn (), userMod);
userMod =
ldapBuildListStr (op, "uid", globalLdap->passent->pw_name, userMod);