dbcheck: Ensure dbcheck can operate with --attrs set
authorAndrew Bartlett <abartlet@samba.org>
Thu, 27 Feb 2014 02:17:35 +0000 (15:17 +1300)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Mar 2014 07:03:07 +0000 (08:03 +0100)
This also includes a test to ensure we do not regress on this point.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
python/samba/dbchecker.py
testprogs/blackbox/dbcheck.sh

index 4281e6bcbc3e87f92e1ad3ba072541199516beb1..e6f26c3753f68c52f6572bc9febb3329e60c6019 100644 (file)
@@ -1142,7 +1142,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
                     self.fix_metadata(dn, att)
 
         if self.is_fsmo_role(dn):
-            if "fSMORoleOwner" not in obj:
+            if "fSMORoleOwner" not in obj and ("*" in attrs or "fsmoroleowner" in map(str.lower, attrs)):
                 self.err_no_fsmoRoleOwner(obj)
                 error_count += 1
 
index c1e8aafd36fc60925e90c63cb3a072870a65b2ea..66628b0519004282f3990b75e2c697b137d2c78f 100755 (executable)
@@ -26,12 +26,17 @@ reindex() {
        $BINDIR/samba-tool dbcheck --reindex
 }
 
+fixed_attrs() {
+       $BINDIR/samba-tool dbcheck --attrs=cn
+}
+
 force_modules() {
        $BINDIR/samba-tool dbcheck --force-modules
 }
 
 testit "dbcheck" dbcheck
 testit "reindex" reindex
+testit "fixed_attrs" fixed_attrs
 testit "force_modules" force_modules
 
 exit $failed