s4:samldb LDB module - convert a "dsdb_module_search" into "dsdb_module_search_dn"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 23 May 2011 10:59:58 +0000 (12:59 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Wed, 25 May 2011 06:57:46 +0000 (08:57 +0200)
It saves us from checking the number of returned entries.

Reviewed-by: abartlet
source4/dsdb/samdb/ldb_modules/samldb.c

index fa0c4f631739cf8eb532438e59f8c40bf7c06480..467558d32da6cc5dc0cf00f6b6f0032d01d4a7e1 100644 (file)
@@ -1095,14 +1095,11 @@ static int samldb_prim_group_change(struct samldb_ctx *ac)
 
        /* Fetch information from the existing object */
 
-       ret = dsdb_module_search(ac->module, ac, &res, ac->msg->dn, LDB_SCOPE_BASE, attrs,
-                                DSDB_FLAG_NEXT_MODULE, ac->req, NULL);
+       ret = dsdb_module_search_dn(ac->module, ac, &res, ac->msg->dn, attrs,
+                                   DSDB_FLAG_NEXT_MODULE, ac->req);
        if (ret != LDB_SUCCESS) {
                return ret;
        }
-       if (res->count != 1) {
-               return ldb_operr(ldb);
-       }
 
        /* Finds out the DN of the old primary group */