LDB:pyldb.c - use always the case insensitive comparison for attribute names
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 11 Feb 2012 11:48:20 +0000 (12:48 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 12 Feb 2012 22:49:12 +0000 (09:49 +1100)
We can make no assumptions about our users

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c

index b253bcd28e60eeff7830db95ff0af4c2eb8b76a9..2f99d1404adbee8860a10f7879bf87e2fc546e77 100644 (file)
@@ -1051,7 +1051,7 @@ static struct ldb_message *PyDict_AsMessage(TALLOC_CTX *mem_ctx,
 
        while (PyDict_Next(py_obj, &dict_pos, &key, &value)) {
                char *key_str = PyString_AsString(key);
-               if (strcmp(key_str, "dn") != 0) {
+               if (ldb_attr_cmp(key_str, "dn") != 0) {
                        msg_el = PyObject_AsMessageElement(msg->elements, value,
                                                           mod_flags, key_str);
                        if (msg_el == NULL) {
@@ -2516,7 +2516,7 @@ static PyObject *py_ldb_msg_getitem_helper(PyLdbMessageObject *self, PyObject *p
                return NULL;
        }
        name = PyString_AsString(py_name);
-       if (!strcmp(name, "dn"))
+       if (!ldb_attr_cmp(name, "dn"))
                return pyldb_Dn_FromDn(msg->dn);
        el = ldb_msg_find_element(msg, name);
        if (el == NULL) {