ldapdiff.patch 893 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Index: ldapmisc.c
  2. --- ldapmisc.c.orig 2005-11-18 22:17:27.000000000 +0100
  3. +++ ldapmisc.c 2006-03-11 09:28:02.345677747 +0100
  4. @@ -29,6 +29,27 @@
  5. #include "ldapdiff.h"
  6. +static char *
  7. +my_strcasestr(s, find)
  8. + const char *s, *find;
  9. +{
  10. + char c, sc;
  11. + size_t len;
  12. +
  13. + if ((c = *find++) != 0) {
  14. + c = tolower((unsigned char)c);
  15. + len = strlen(find);
  16. + do {
  17. + do {
  18. + if ((sc = *s++) == 0)
  19. + return (NULL);
  20. + } while ((char)tolower((unsigned char)sc) != c);
  21. + } while (strncasecmp(s, find, len) != 0);
  22. + s--;
  23. + }
  24. + return ((char *)s);
  25. +}
  26. +
  27. int ldifcheckbase(char *attrbase)
  28. {
  29. char *confbase;
  30. @@ -36,7 +57,7 @@
  31. confbase = ldifgetpconf(CONFBASEDN);
  32. - if((pos = strcasestr(attrbase,confbase)) == NULL){
  33. + if((pos = my_strcasestr(attrbase,confbase)) == NULL){
  34. return -1;
  35. }