Lines 114-120
int cache_dump_entry(char *dn, CacheEntry *entry, FILE *fp)
|
Link Here
|
---|
|
114 |
if (len >= 0) { |
114 |
if (len >= 0) { |
115 |
char *base64_value; |
115 |
char *base64_value; |
116 |
size_t srclen = attribute->length[j] - 1; |
116 |
size_t srclen = attribute->length[j] - 1; |
117 |
base64_value = malloc(BASE64_ENCODE_LEN(srclen)+1); |
117 |
base64_value = malloc(BASE64_ENCODE_LEN(srclen) + 1); |
118 |
if (!base64_value) |
118 |
if (!base64_value) |
119 |
return 1; |
119 |
return 1; |
120 |
base64_encode((u_char *)value, srclen, base64_value, BASE64_ENCODE_LEN(srclen) + 1); |
120 |
base64_encode((u_char *)value, srclen, base64_value, BASE64_ENCODE_LEN(srclen) + 1); |
Lines 125-131
int cache_dump_entry(char *dn, CacheEntry *entry, FILE *fp)
|
Link Here
|
---|
|
125 |
} |
125 |
} |
126 |
} |
126 |
} |
127 |
} |
127 |
} |
128 |
for (module=entry->modules; module != NULL && *module != NULL; module++) { |
128 |
for (module = entry->modules; module != NULL && *module != NULL; module++) { |
129 |
fprintf(fp, "listenerModule: %s\n", *module); |
129 |
fprintf(fp, "listenerModule: %s\n", *module); |
130 |
} |
130 |
} |
131 |
|
131 |
|
Lines 136-147
int cache_entry_module_add(CacheEntry *entry, char *module)
|
Link Here
|
---|
|
136 |
{ |
136 |
{ |
137 |
char **cur; |
137 |
char **cur; |
138 |
|
138 |
|
139 |
for (cur=entry->modules; cur != NULL && *cur != NULL; cur++) { |
139 |
for (cur = entry->modules; cur != NULL && *cur != NULL; cur++) { |
140 |
if (strcmp(*cur, module) == 0) |
140 |
if (strcmp(*cur, module) == 0) |
141 |
return 0; |
141 |
return 0; |
142 |
} |
142 |
} |
143 |
|
143 |
|
144 |
entry->modules = realloc(entry->modules, (entry->module_count+2)*sizeof(char*)); |
144 |
entry->modules = realloc(entry->modules, (entry->module_count + 2) * sizeof(char*)); |
145 |
if (!entry->modules) |
145 |
if (!entry->modules) |
146 |
return 1; |
146 |
return 1; |
147 |
entry->modules[entry->module_count++] = strdup(module); |
147 |
entry->modules[entry->module_count++] = strdup(module); |
Lines 154-160
int cache_entry_module_remove(CacheEntry *entry, char *module)
|
Link Here
|
---|
|
154 |
{ |
154 |
{ |
155 |
char **cur; |
155 |
char **cur; |
156 |
|
156 |
|
157 |
for (cur=entry->modules; cur != NULL && *cur != NULL; cur++) { |
157 |
for (cur = entry->modules; cur != NULL && *cur != NULL; cur++) { |
158 |
if (strcmp(*cur, module) == 0) |
158 |
if (strcmp(*cur, module) == 0) |
159 |
break; |
159 |
break; |
160 |
} |
160 |
} |
Lines 164-173
int cache_entry_module_remove(CacheEntry *entry, char *module)
|
Link Here
|
---|
|
164 |
|
164 |
|
165 |
/* replace entry that is to be removed with last entry */ |
165 |
/* replace entry that is to be removed with last entry */ |
166 |
free(*cur); |
166 |
free(*cur); |
167 |
entry->modules[cur-entry->modules] = entry->modules[entry->module_count-1]; |
167 |
entry->modules[cur-entry->modules] = entry->modules[entry->module_count - 1]; |
168 |
entry->modules[--entry->module_count] = NULL; |
168 |
entry->modules[--entry->module_count] = NULL; |
169 |
|
169 |
|
170 |
entry->modules = realloc(entry->modules, (entry->module_count+1)*sizeof(char*)); |
170 |
entry->modules = realloc(entry->modules, (entry->module_count + 1) * sizeof(char*)); |
171 |
|
171 |
|
172 |
return 0; |
172 |
return 0; |
173 |
} |
173 |
} |
Lines 178-184
int cache_entry_module_present(CacheEntry *entry, char *module)
|
Link Here
|
---|
|
178 |
|
178 |
|
179 |
if (entry == NULL) |
179 |
if (entry == NULL) |
180 |
return 0; |
180 |
return 0; |
181 |
for (cur=entry->modules; cur != NULL && *cur != NULL; cur++) { |
181 |
for (cur = entry->modules; cur != NULL && *cur != NULL; cur++) { |
182 |
if (strcmp(*cur, module) == 0) |
182 |
if (strcmp(*cur, module) == 0) |
183 |
return 1; |
183 |
return 1; |
184 |
} |
184 |
} |
Lines 200-215
int cache_new_entry_from_ldap(char **dn, CacheEntry *cache_entry, LDAP *ld, LDAP
|
Link Here
|
---|
|
200 |
memset(cache_entry, 0, sizeof(CacheEntry)); |
200 |
memset(cache_entry, 0, sizeof(CacheEntry)); |
201 |
if (dn != NULL) { |
201 |
if (dn != NULL) { |
202 |
char *_dn = ldap_get_dn(ld, ldap_entry); |
202 |
char *_dn = ldap_get_dn(ld, ldap_entry); |
203 |
if(*dn) |
203 |
if (*dn) |
204 |
free(*dn); |
204 |
free(*dn); |
205 |
*dn = strdup(_dn); |
205 |
*dn = strdup(_dn); |
206 |
ldap_memfree(_dn); |
206 |
ldap_memfree(_dn); |
207 |
} |
207 |
} |
208 |
|
208 |
|
209 |
for (attr=ldap_first_attribute(ld, ldap_entry, &ber); attr != NULL; attr=ldap_next_attribute(ld, ldap_entry, ber)) { |
209 |
for (attr = ldap_first_attribute(ld, ldap_entry, &ber); |
|
|
210 |
attr != NULL; |
211 |
attr = ldap_next_attribute(ld, ldap_entry, ber)) { |
210 |
struct berval **val, **v; |
212 |
struct berval **val, **v; |
211 |
|
213 |
|
212 |
if ((cache_entry->attributes = realloc(cache_entry->attributes, (cache_entry->attribute_count+2)*sizeof(CacheEntryAttribute*))) == NULL) { |
214 |
if ((cache_entry->attributes = realloc(cache_entry->attributes, (cache_entry->attribute_count + 2) * sizeof(CacheEntryAttribute*))) == NULL) { |
213 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "cache_new_entry_from_ldap: realloc of attributes array failed"); |
215 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "cache_new_entry_from_ldap: realloc of attributes array failed"); |
214 |
goto result; |
216 |
goto result; |
215 |
} |
217 |
} |
Lines 230-241
int cache_new_entry_from_ldap(char **dn, CacheEntry *cache_entry, LDAP *ld, LDAP
|
Link Here
|
---|
|
230 |
check = UNIQUE_MEMBER; |
232 |
check = UNIQUE_MEMBER; |
231 |
else |
233 |
else |
232 |
check = DUPLICATES; |
234 |
check = DUPLICATES; |
233 |
if ((val=ldap_get_values_len(ld, ldap_entry, attr)) == NULL) { |
235 |
if ((val = ldap_get_values_len(ld, ldap_entry, attr)) == NULL) { |
234 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ldap_get_values failed"); |
236 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ldap_get_values failed"); |
235 |
goto result; |
237 |
goto result; |
236 |
} |
238 |
} |
237 |
for (v = val; *v != NULL; v++) { |
239 |
for (v = val; *v != NULL; v++) { |
238 |
if ( (*v)->bv_val == NULL ) { |
240 |
if ((*v)->bv_val == NULL) { |
239 |
// check here, strlen behavior might be undefined in this case |
241 |
// check here, strlen behavior might be undefined in this case |
240 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "cache_new_entry_from_ldap: ignoring bv_val of NULL with bv_len=%ld, ignoring, check attribute: %s of DN: %s", (*v)->bv_len, c_attr->name, *dn); |
242 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "cache_new_entry_from_ldap: ignoring bv_val of NULL with bv_len=%ld, ignoring, check attribute: %s of DN: %s", (*v)->bv_len, c_attr->name, *dn); |
241 |
goto result; |
243 |
goto result; |
Lines 243-249
int cache_new_entry_from_ldap(char **dn, CacheEntry *cache_entry, LDAP *ld, LDAP
|
Link Here
|
---|
|
243 |
if (memberUidMode && check == UNIQUE_UID) { |
245 |
if (memberUidMode && check == UNIQUE_UID) { |
244 |
/* avoid duplicate memberUid entries https://forge.univention.org/bugzilla/show_bug.cgi?id=17998 */ |
246 |
/* avoid duplicate memberUid entries https://forge.univention.org/bugzilla/show_bug.cgi?id=17998 */ |
245 |
for (i = 0; i < c_attr->value_count; i++) { |
247 |
for (i = 0; i < c_attr->value_count; i++) { |
246 |
if (!memcmp(c_attr->values[i], (*v)->bv_val, (*v)->bv_len+1) ) { |
248 |
if (!memcmp(c_attr->values[i], (*v)->bv_val, (*v)->bv_len + 1) ) { |
247 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "Found a duplicate memberUid entry:"); |
249 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "Found a duplicate memberUid entry:"); |
248 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "DN: %s", *dn); |
250 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "DN: %s", *dn); |
249 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "memberUid: %s", c_attr->values[i]); |
251 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "memberUid: %s", c_attr->values[i]); |
Lines 257-263
int cache_new_entry_from_ldap(char **dn, CacheEntry *cache_entry, LDAP *ld, LDAP
|
Link Here
|
---|
|
257 |
if (uniqueMemberMode && check == UNIQUE_MEMBER) { |
259 |
if (uniqueMemberMode && check == UNIQUE_MEMBER) { |
258 |
/* avoid duplicate uniqueMember entries https://forge.univention.org/bugzilla/show_bug.cgi?id=18692 */ |
260 |
/* avoid duplicate uniqueMember entries https://forge.univention.org/bugzilla/show_bug.cgi?id=18692 */ |
259 |
for (i = 0; i < c_attr->value_count; i++) { |
261 |
for (i = 0; i < c_attr->value_count; i++) { |
260 |
if (!memcmp(c_attr->values[i], (*v)->bv_val, (*v)->bv_len+1)) { |
262 |
if (!memcmp(c_attr->values[i], (*v)->bv_val, (*v)->bv_len + 1)) { |
261 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "Found a duplicate uniqueMember entry:"); |
263 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "Found a duplicate uniqueMember entry:"); |
262 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "DN: %s", *dn); |
264 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "DN: %s", *dn); |
263 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "uniqueMember: %s", c_attr->values[i]); |
265 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "uniqueMember: %s", c_attr->values[i]); |
Lines 331-337
char** cache_entry_changed_attributes(CacheEntry *new, CacheEntry *old)
|
Link Here
|
---|
|
331 |
continue; |
333 |
continue; |
332 |
} |
334 |
} |
333 |
|
335 |
|
334 |
changes = realloc(changes, (changes_count+2)*sizeof(char*)); |
336 |
changes = realloc(changes, (changes_count + 2) * sizeof(char*)); |
335 |
changes[changes_count++] = (*cur1)->name; |
337 |
changes[changes_count++] = (*cur1)->name; |
336 |
changes[changes_count] = NULL; |
338 |
changes[changes_count] = NULL; |
337 |
} |
339 |
} |
Lines 343-349
char** cache_entry_changed_attributes(CacheEntry *new, CacheEntry *old)
|
Link Here
|
---|
|
343 |
if (cur1 != NULL && *cur1 != NULL) |
345 |
if (cur1 != NULL && *cur1 != NULL) |
344 |
continue; |
346 |
continue; |
345 |
|
347 |
|
346 |
changes = realloc(changes, (changes_count+2)*sizeof(char*)); |
348 |
changes = realloc(changes, (changes_count + 2) * sizeof(char*)); |
347 |
changes[changes_count++] = (*cur2)->name; |
349 |
changes[changes_count++] = (*cur2)->name; |
348 |
changes[changes_count] = NULL; |
350 |
changes[changes_count] = NULL; |
349 |
} |
351 |
} |
Lines 353-363
char** cache_entry_changed_attributes(CacheEntry *new, CacheEntry *old)
|
Link Here
|
---|
|
353 |
|
355 |
|
354 |
int copy_cache_entry(CacheEntry *cache_entry, CacheEntry *backup_cache_entry) { |
356 |
int copy_cache_entry(CacheEntry *cache_entry, CacheEntry *backup_cache_entry) { |
355 |
CacheEntryAttribute **cur1, **cur2; |
357 |
CacheEntryAttribute **cur1, **cur2; |
356 |
int i=0; |
358 |
int i; |
357 |
int rv=1; |
359 |
int rv = 1; |
|
|
360 |
|
358 |
memset(backup_cache_entry, 0, sizeof(CacheEntry)); |
361 |
memset(backup_cache_entry, 0, sizeof(CacheEntry)); |
359 |
for (cur1 = cache_entry->attributes; cur1 != NULL && *cur1 != NULL; cur1++) { |
362 |
for (cur1 = cache_entry->attributes; cur1 != NULL && *cur1 != NULL; cur1++) { |
360 |
if ((backup_cache_entry->attributes = realloc(backup_cache_entry->attributes, (backup_cache_entry->attribute_count+2)*sizeof(CacheEntryAttribute*))) == NULL) { |
363 |
if ((backup_cache_entry->attributes = realloc(backup_cache_entry->attributes, (backup_cache_entry->attribute_count + 2) * sizeof(CacheEntryAttribute*))) == NULL) { |
361 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: realloc of attributes array failed"); |
364 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: realloc of attributes array failed"); |
362 |
goto result; |
365 |
goto result; |
363 |
} |
366 |
} |
Lines 366-410
int copy_cache_entry(CacheEntry *cache_entry, CacheEntry *backup_cache_entry) {
|
Link Here
|
---|
|
366 |
goto result; |
369 |
goto result; |
367 |
} |
370 |
} |
368 |
cur2 = &backup_cache_entry->attributes[backup_cache_entry->attribute_count]; |
371 |
cur2 = &backup_cache_entry->attributes[backup_cache_entry->attribute_count]; |
369 |
(*cur2)->name=strdup((*cur1)->name); |
372 |
(*cur2)->name = strdup((*cur1)->name); |
370 |
(*cur2)->values=NULL; |
373 |
(*cur2)->values = NULL; |
371 |
(*cur2)->length=NULL; |
374 |
(*cur2)->length = NULL; |
372 |
(*cur2)->value_count=0; |
375 |
(*cur2)->value_count = 0; |
373 |
backup_cache_entry->attributes[backup_cache_entry->attribute_count+1]=NULL; |
376 |
backup_cache_entry->attributes[backup_cache_entry->attribute_count + 1] = NULL; |
374 |
|
377 |
|
375 |
for (i = 0; i < (*cur1)->value_count; i++) { |
378 |
for (i = 0; i < (*cur1)->value_count; i++) { |
376 |
if (((*cur2)->values = realloc((*cur2)->values, ((*cur2)->value_count+2)*sizeof(char*))) == NULL) { |
379 |
if (((*cur2)->values = realloc((*cur2)->values, ((*cur2)->value_count + 2) * sizeof(char*))) == NULL) { |
377 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: realloc of values array failed"); |
380 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: realloc of values array failed"); |
378 |
goto result; |
381 |
goto result; |
379 |
} |
382 |
} |
380 |
if (((*cur2)->length = realloc((*cur2)->length, ((*cur2)->value_count+2)*sizeof(int))) == NULL) { |
383 |
if (((*cur2)->length = realloc((*cur2)->length, ((*cur2)->value_count + 2) * sizeof(int))) == NULL) { |
381 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: realloc of length array failed"); |
384 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: realloc of length array failed"); |
382 |
goto result; |
385 |
goto result; |
383 |
} |
386 |
} |
384 |
if ((*cur1)->length[i] == strlen((*cur1)->values[i]) + 1) { |
387 |
if ((*cur1)->length[i] == strlen((*cur1)->values[i]) + 1) { |
385 |
if (((*cur2)->values[(*cur2)->value_count]=strdup((*cur1)->values[i])) == NULL) { |
388 |
if (((*cur2)->values[(*cur2)->value_count] = strdup((*cur1)->values[i])) == NULL) { |
386 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: strdup of value failed"); |
389 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: strdup of value failed"); |
387 |
goto result; |
390 |
goto result; |
388 |
} |
391 |
} |
389 |
(*cur2)->length[(*cur2)->value_count]=strlen((*cur2)->values[(*cur2)->value_count])+1; |
392 |
(*cur2)->length[(*cur2)->value_count] = strlen((*cur2)->values[(*cur2)->value_count]) + 1; |
390 |
} else { |
393 |
} else { |
391 |
if (((*cur2)->values[(*cur2)->value_count]=malloc(((*cur1)->length[i])*sizeof(char))) == NULL) { |
394 |
if (((*cur2)->values[(*cur2)->value_count] = malloc(((*cur1)->length[i]) * sizeof(char))) == NULL) { |
392 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: malloc for value failed"); |
395 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "copy_cache_entry: malloc for value failed"); |
393 |
goto result; |
396 |
goto result; |
394 |
} |
397 |
} |
395 |
memcpy((*cur2)->values[(*cur2)->value_count],(*cur1)->values[i],(*cur1)->length[i]); |
398 |
memcpy((*cur2)->values[(*cur2)->value_count], (*cur1)->values[i], (*cur1)->length[i]); |
396 |
(*cur2)->length[(*cur2)->value_count]=(*cur1)->length[i]; |
399 |
(*cur2)->length[(*cur2)->value_count] = (*cur1)->length[i]; |
397 |
} |
400 |
} |
398 |
(*cur2)->values[(*cur2)->value_count+1]=NULL; |
401 |
(*cur2)->values[(*cur2)->value_count+1] = NULL; |
399 |
(*cur2)->value_count++; |
402 |
(*cur2)->value_count++; |
400 |
} |
403 |
} |
401 |
backup_cache_entry->attribute_count++; |
404 |
backup_cache_entry->attribute_count++; |
402 |
} |
405 |
} |
403 |
char **module_ptr; |
406 |
char **module_ptr; |
404 |
for (module_ptr=cache_entry->modules; module_ptr != NULL && *module_ptr != NULL; module_ptr++) { |
407 |
for (module_ptr = cache_entry->modules; module_ptr != NULL && *module_ptr != NULL; module_ptr++) { |
405 |
backup_cache_entry->modules = realloc(backup_cache_entry->modules, (backup_cache_entry->module_count+2)*sizeof(char*)); |
408 |
backup_cache_entry->modules = realloc(backup_cache_entry->modules, (backup_cache_entry->module_count + 2) * sizeof(char*)); |
406 |
backup_cache_entry->modules[backup_cache_entry->module_count] = strdup(*module_ptr); |
409 |
backup_cache_entry->modules[backup_cache_entry->module_count] = strdup(*module_ptr); |
407 |
backup_cache_entry->modules[backup_cache_entry->module_count+1] = NULL; |
410 |
backup_cache_entry->modules[backup_cache_entry->module_count +1] = NULL; |
408 |
backup_cache_entry->module_count++; |
411 |
backup_cache_entry->module_count++; |
409 |
} |
412 |
} |
410 |
rv = 0; |
413 |
rv = 0; |
Lines 414-429
result:
|
Link Here
|
---|
|
414 |
|
417 |
|
415 |
void compare_cache_entries(CacheEntry *lentry, CacheEntry *rentry) |
418 |
void compare_cache_entries(CacheEntry *lentry, CacheEntry *rentry) |
416 |
{ |
419 |
{ |
417 |
char **changes; |
420 |
char **changes; |
418 |
char **cur; |
421 |
char **cur; |
419 |
int i=0; |
422 |
int i; |
420 |
|
423 |
|
421 |
changes = cache_entry_changed_attributes(lentry, rentry); |
424 |
changes = cache_entry_changed_attributes(lentry, rentry); |
422 |
|
425 |
|
423 |
for (cur = changes; cur != NULL && *cur != NULL; cur++) { |
426 |
for (cur = changes; cur != NULL && *cur != NULL; cur++) { |
424 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: %s differs\n", *cur); |
427 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: %s differs\n", *cur); |
425 |
|
428 |
|
426 |
for (i=0; lentry->attributes != NULL && lentry->attributes[i] != NULL; i++) { |
429 |
for (i = 0; lentry->attributes != NULL && lentry->attributes[i] != NULL; i++) { |
427 |
if (strcmp(lentry->attributes[i]->name, *cur) == 0) |
430 |
if (strcmp(lentry->attributes[i]->name, *cur) == 0) |
428 |
break; |
431 |
break; |
429 |
} |
432 |
} |
Lines 432-438
void compare_cache_entries(CacheEntry *lentry, CacheEntry *rentry)
|
Link Here
|
---|
|
432 |
} else { |
435 |
} else { |
433 |
int j; |
436 |
int j; |
434 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: lentry = ["); |
437 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: lentry = ["); |
435 |
for (j=0; lentry->attributes[i]->values && |
438 |
for (j = 0; lentry->attributes[i]->values && |
436 |
lentry->attributes[i]->values[j] != NULL; |
439 |
lentry->attributes[i]->values[j] != NULL; |
437 |
j++) { |
440 |
j++) { |
438 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, j == 0 ? "%s" : ", %s", lentry->attributes[i]->values[j]); |
441 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, j == 0 ? "%s" : ", %s", lentry->attributes[i]->values[j]); |
Lines 440-446
void compare_cache_entries(CacheEntry *lentry, CacheEntry *rentry)
|
Link Here
|
---|
|
440 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "]\n"); |
443 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "]\n"); |
441 |
} |
444 |
} |
442 |
|
445 |
|
443 |
for (i=0; rentry->attributes != NULL && rentry->attributes[i] != NULL; i++) { |
446 |
for (i = 0; rentry->attributes != NULL && rentry->attributes[i] != NULL; i++) { |
444 |
if (strcmp(rentry->attributes[i]->name, *cur) == 0) |
447 |
if (strcmp(rentry->attributes[i]->name, *cur) == 0) |
445 |
break; |
448 |
break; |
446 |
} |
449 |
} |
Lines 449-455
void compare_cache_entries(CacheEntry *lentry, CacheEntry *rentry)
|
Link Here
|
---|
|
449 |
} else { |
452 |
} else { |
450 |
int j; |
453 |
int j; |
451 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: rentry = ["); |
454 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: rentry = ["); |
452 |
for (j=0; rentry->attributes[i]->values && |
455 |
for (j = 0; rentry->attributes[i]->values && |
453 |
rentry->attributes[i]->values[j] != NULL; |
456 |
rentry->attributes[i]->values[j] != NULL; |
454 |
j++) { |
457 |
j++) { |
455 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, j == 0 ? "%s" : ", %s", rentry->attributes[i]->values[j]); |
458 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, j == 0 ? "%s" : ", %s", rentry->attributes[i]->values[j]); |
Lines 459-476
void compare_cache_entries(CacheEntry *lentry, CacheEntry *rentry)
|
Link Here
|
---|
|
459 |
} |
462 |
} |
460 |
free(changes); |
463 |
free(changes); |
461 |
|
464 |
|
462 |
char **cur1, **cur2; |
465 |
char **cur1, **cur2; |
463 |
|
466 |
|
464 |
for (cur1=lentry->modules; cur1 != NULL && *cur1 != NULL; cur1++) { |
467 |
for (cur1 = lentry->modules; cur1 != NULL && *cur1 != NULL; cur1++) { |
465 |
for (cur2=rentry->modules; cur2 != NULL && *cur2 != NULL; cur2++) |
468 |
for (cur2 = rentry->modules; cur2 != NULL && *cur2 != NULL; cur2++) |
466 |
if (strcmp(*cur1, *cur2) == 0) |
469 |
if (strcmp(*cur1, *cur2) == 0) |
467 |
break; |
470 |
break; |
468 |
if (cur2 != NULL && *cur2 != NULL) |
471 |
if (cur2 != NULL && *cur2 != NULL) |
469 |
continue; |
472 |
continue; |
470 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: module %s on lentry missing on rentry\n", *cur1); |
473 |
univention_debug(UV_DEBUG_LISTENER, UV_DEBUG_ERROR, "ALERT: module %s on lentry missing on rentry\n", *cur1); |
471 |
} |
474 |
} |
472 |
for (cur2=rentry->modules; cur2 != NULL && *cur2 != NULL; cur2++) { |
475 |
for (cur2 = rentry->modules; cur2 != NULL && *cur2 != NULL; cur2++) { |
473 |
for (cur1=lentry->modules; cur1 != NULL && *cur1 != NULL; cur1++) |
476 |
for (cur1 = lentry->modules; cur1 != NULL && *cur1 != NULL; cur1++) |
474 |
if (strcmp(*cur1, *cur2) == 0) |
477 |
if (strcmp(*cur1, *cur2) == 0) |
475 |
break; |
478 |
break; |
476 |
if (cur1 != NULL && *cur1 != NULL) |
479 |
if (cur1 != NULL && *cur1 != NULL) |