diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-16 20:48:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:54 -0500 |
commit | 5dbebbe2add359da8c416634e3ec2d8e2569478a (patch) | |
tree | 95d6622ec59cf658d4fa68127d623e78b4a92696 | |
parent | 7b0f375a86a593004acc768b48fd3881ec46fa6a (diff) | |
download | samba-5dbebbe2add359da8c416634e3ec2d8e2569478a.tar.gz samba-5dbebbe2add359da8c416634e3ec2d8e2569478a.tar.bz2 samba-5dbebbe2add359da8c416634e3ec2d8e2569478a.zip |
r4781: the tolower() in schema.c is a premature optimisation. I suspect the
"distinguishedName" checking in that module is incorrect and should be
removed, but meanwhile, lets not make it slow down the compile of
every other module.
(This used to be commit 6534ce650bef7405e0926c9b75b185943429ed18)
-rw-r--r-- | source4/include/includes.h | 4 | ||||
-rw-r--r-- | source4/lib/ldb/modules/schema.c | 17 |
2 files changed, 8 insertions, 13 deletions
diff --git a/source4/include/includes.h b/source4/include/includes.h index b6f49ed827..cc03607e91 100644 --- a/source4/include/includes.h +++ b/source4/include/includes.h @@ -53,10 +53,6 @@ #include <stddef.h> #include <sys/time.h> -#ifdef HAVE_CTYPE_H -#include <ctype.h> -#endif - #ifdef HAVE_STDINT_H #include <stdint.h> #endif diff --git a/source4/lib/ldb/modules/schema.c b/source4/lib/ldb/modules/schema.c index 114c7f44aa..7a772d87aa 100644 --- a/source4/lib/ldb/modules/schema.c +++ b/source4/lib/ldb/modules/schema.c @@ -35,6 +35,7 @@ #include "includes.h" #include "ldb/include/ldb.h" #include "ldb/include/ldb_private.h" +#include <ctype.h> struct attribute_syntax { const char *name; @@ -103,15 +104,13 @@ static int schema_attr_cmp(const char *attr1, const char *attr2) ret = ldb_attr_cmp(attr1, attr2); if (ret != 0) { - if (tolower(*attr1) == 'd' && tolower(*attr2) == 'd') { - if ((ldb_attr_cmp("dn", attr1) == 0) && - (ldb_attr_cmp("distinguishedName", attr2) == 0)) { - return 0; - } - if ((ldb_attr_cmp("dn", attr2) == 0) && - (ldb_attr_cmp("distinguishedName", attr1) == 0)) { - return 0; - } + if ((ldb_attr_cmp("dn", attr1) == 0) && + (ldb_attr_cmp("distinguishedName", attr2) == 0)) { + return 0; + } + if ((ldb_attr_cmp("dn", attr2) == 0) && + (ldb_attr_cmp("distinguishedName", attr1) == 0)) { + return 0; } } return ret; |