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