dbcheck: Ensure dbcheck can operate with --attrs set
authorAndrew Bartlett <abartlet@samba.org>
Thu, 27 Feb 2014 02:17:35 +0000 (15:17 +1300)
committerKarolin Seeger <kseeger@samba.org>
Tue, 15 Jul 2014 10:46:16 +0000 (12:46 +0200)
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>
(cherry picked from commit f596dc94e1ab839f13e2a9edbcec774635b5c211)

python/samba/dbchecker.py
testprogs/blackbox/dbcheck.sh

index e96062e475b39d42fede5ba56498f3be6cda381a..c65861087f7b7dc706767dbb989500f8a1d326d4 100644 (file)
@@ -1268,7 +1268,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