s4:samldb LDB module - check for the number of results after a search operation
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 31 Oct 2010 10:03:59 +0000 (11:03 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 31 Oct 2010 18:44:06 +0000 (18:44 +0000)
Should always be done.

source4/dsdb/samdb/ldb_modules/samldb.c

index 9b6d6e03ccc8b0d50e8a0eced70dc39458fe1df7..f4b7043e32e0ec844d28aec4c9e26046bc7c3bb4 100644 (file)
@@ -1067,6 +1067,9 @@ static int samldb_prim_group_change(struct samldb_ctx *ac)
        if (ret != LDB_SUCCESS) {
                return ret;
        }
+       if (res->count != 1) {
+               return ldb_operr(ldb);
+       }
 
        /* Finds out the DN of the old primary group */