1 |
diff -up cpu-1.4.3/src/plugins/ldap/ld.c.mod-delete cpu-1.4.3/src/plugins/ldap/ld.c |
2 |
--- cpu-1.4.3/src/plugins/ldap/ld.c.mod-delete 2010-11-05 21:41:38.000000000 -0600 |
3 |
+++ cpu-1.4.3/src/plugins/ldap/ld.c 2010-11-05 21:45:29.000000000 -0600 |
4 |
@@ -285,19 +285,26 @@ ldapBuildListStr (int mod_op, char *mod_ |
5 |
if (mod_type == NULL || strlen(mod_type) == strspn(mod_type, " ")) |
6 |
return mods; |
7 |
|
8 |
- if (value == NULL || strlen(value) == strspn(value, " ")) |
9 |
- return mods; |
10 |
- |
11 |
mods = ldapAddList (mods); |
12 |
|
13 |
- temp = (char **) malloc (sizeof (char *) * 2); |
14 |
- bzero (temp, sizeof (char *) * 2); |
15 |
- temp[0] = value; |
16 |
- temp[1] = NULL; |
17 |
+ if (value == NULL || strlen(value) == strspn(value, " ")) |
18 |
+ { |
19 |
+ mods[list_size]->mod_op = LDAP_MOD_DELETE; |
20 |
+ mods[list_size]->mod_type = strdup (mod_type); |
21 |
+ mods[list_size]->mod_values = NULL; |
22 |
+ } |
23 |
+ else |
24 |
+ { |
25 |
+ temp = (char **) malloc (sizeof (char *) * 2); |
26 |
+ bzero (temp, sizeof (char *) * 2); |
27 |
+ temp[0] = value; |
28 |
+ temp[1] = NULL; |
29 |
+ |
30 |
+ mods[list_size]->mod_op = mod_op; |
31 |
+ mods[list_size]->mod_type = strdup (mod_type); |
32 |
+ mods[list_size]->mod_values = temp; |
33 |
+ } |
34 |
|
35 |
- mods[list_size]->mod_op = mod_op; |
36 |
- mods[list_size]->mod_type = strdup (mod_type); |
37 |
- mods[list_size]->mod_values = temp; |
38 |
list_size++; |
39 |
return mods; |
40 |
} |