extended_dn_out: use ldb_attr_cmp not strcasecmp() and handle '*' as an attr
authorAndrew Bartlett <abartlet@samba.org>
Wed, 10 Dec 2008 04:30:44 +0000 (15:30 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Dec 2008 04:30:44 +0000 (15:30 +1100)
Also fix some indentation

source4/dsdb/samdb/ldb_modules/extended_dn_out.c

index 142db68bb14a5813dc9f520eca2235583d3cc46e..deca9689174b308bbb9631940645a8e7d50d49c4 100644 (file)
@@ -49,7 +49,7 @@ static bool is_attr_in_list(const char * const * attrs, const char *attr)
        int i;
 
        for (i = 0; attrs[i]; i++) {
-               if (strcasecmp(attrs[i], attr) == 0)
+               if (ldb_attr_cmp(attrs[i], attr) == 0)
                        return true;
        }
 
@@ -99,10 +99,10 @@ static bool add_attrs(void *mem_ctx, char ***attrs, const char *attr)
 }
 
 static int inject_extended_dn_out(struct ldb_reply *ares,
-                             struct ldb_context *ldb,
-                             int type,
-                             bool remove_guid,
-                             bool remove_sid)
+                                 struct ldb_context *ldb,
+                                 int type,
+                                 bool remove_guid,
+                                 bool remove_sid)
 {
        int ret;
        const struct ldb_val *val;
@@ -385,7 +385,7 @@ static int extended_dn_out_search(struct ldb_module *module, struct ldb_request
                }
 
                /* check if attrs only is specified, in that case check wether we need to modify them */
-               if (req->op.search.attrs) {
+               if (req->op.search.attrs && !is_attr_in_list(req->op.search.attrs, "*")) {
                        if (! is_attr_in_list(req->op.search.attrs, "objectGUID")) {
                                ac->remove_guid = true;
                        }