[SCM] Samba Shared Repository - branch v4-14-test updated

Karolin Seeger kseeger at samba.org
Mon Feb 22 12:01:02 UTC 2021


The branch, v4-14-test has been updated
       via  42dbd31f739 dbcheck: Check Deleted Objects and reduce noise in reports about expired tombstones
       via  b3cd04c1038 selftest: Confirm that we fix any errors on the Deleted Objects container itself
       via  1f520ec35e1 printing: use correct error out in get_correct_cversion() when openat_pathref_fsp() fails
       via  b30a1950e26 printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails
       via  5b1a5b776a7 printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails
      from  d339556659c VERSION: Bump version up to 4.14.0rc4...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-14-test


- Log -----------------------------------------------------------------
commit 42dbd31f73960b4d0c82fe8a8f3f02e6fff3f0c2
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Dec 10 16:03:49 2020 +1300

    dbcheck: Check Deleted Objects and reduce noise in reports about expired tombstones
    
    These reports (about recently deleted objects)
    create concern about a perfectly normal part of DB operation.
    
    We must not operate on objects that are expired or we might reanimate them,
    but we must fix "Deleted Objects" if it is wrong (mostly it is set as being
    deleted in 9999, but in alpha19 we got this wrong).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14593
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Feb  3 05:29:11 UTC 2021 on sn-devel-184
    
    (cherry picked from commit da627106cdbf8d375b25fa3338a717447f3dbb6e)
    
    Autobuild-User(v4-14-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-14-test): Mon Feb 22 12:00:43 UTC 2021 on sn-devel-184

commit b3cd04c10389f6d6793448de29169de9eb365842
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Dec 11 15:37:04 2020 +1300

    selftest: Confirm that we fix any errors on the Deleted Objects container itself
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14593
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    (cherry picked from commit 1ec1c35a3ae422720df491f5555c9bc787c9944c)

commit 1f520ec35e151bcde8103ba6cfbdced67b242d0a
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 16 14:24:05 2021 +0100

    printing: use correct error out in get_correct_cversion() when openat_pathref_fsp() fails
    
    Fixes a regression introduced by a74f0af1a91fe0bbc68e4d41d65f43ec383ae8bf: if
    there's no existing file, openat_pathref_fsp() will fail with
    NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by
    the SMB_VFS_CREATE_FILE() call below.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14635
    RN: Printerdriver upload 4.14rc1 not working
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Wed Feb 17 19:53:00 UTC 2021 on sn-devel-184
    
    (cherry picked from commit 718f7b1a84f1c6eb35d52232a8573370f45add56)

commit b30a1950e260fb7fd098da2deff608b7c505ef0d
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 16 14:23:02 2021 +0100

    printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails
    
    Fixes a regression introduced by ef5e913bca584f0232d5bfff14df4ccba2dda35c: if
    there's no existing file, openat_pathref_fsp() will fail with
    NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by
    the SMB_VFS_CREATE_FILE() call below.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14635
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit 70063c523bff5e471eac2b011b243c5aa0c4bee1)

commit 5b1a5b776a7bed76695599211397469666fb2142
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 16 14:19:51 2021 +0100

    printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails
    
    Fixes a regression introduced by cbe25e1777d0c43c21e8acc2cea79fd03fdaf2ea: if
    there's no existing file, openat_pathref_fsp() will fail with
    NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by
    the SMB_VFS_CREATE_FILE() call below.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14635
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit 8c1fd86db873f0326faf1cefa731a03709f8ac7f)

-----------------------------------------------------------------------

Summary of changes:
 python/samba/dbchecker.py                          | 25 +++++++++++++++++++++-
 source3/printing/nt_printing.c                     | 12 ++++++++---
 ...cted-dbcheck-link-output-lost-deleted-user3.txt | 16 +++++++-------
 testprogs/blackbox/dbcheck-links.sh                |  2 +-
 testprogs/blackbox/dbcheck-oldrelease.sh           | 12 +++++++++++
 5 files changed, 54 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 364dc9427d7..d10d765434c 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -1816,6 +1816,11 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
             # old static provision dumps
             return False
 
+        if dn in self.deleted_objects_containers:
+            # The Deleted Objects container will look like an expired
+            # tombstone
+            return False
+
         repl = ndr_unpack(drsblobs.replPropertyMetaDataBlob, repl_val)
 
         isDeleted = self.find_repl_attid(repl, drsuapi.DRSUAPI_ATTID_isDeleted)
@@ -1829,7 +1834,25 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
         if delta <= tombstone_delta:
             return False
 
-        self.report("SKIPING: object %s is an expired tombstone" % dn)
+        expunge_time = delete_time + tombstone_delta
+
+        delta_days = delta / (24 * 60 * 60)
+
+        if delta_days <= 2:
+            self.report("SKIPPING additional checks on object "
+                        "%s which very recently "
+                        "became an expired tombstone (normal)" % dn)
+            self.report("INFO: it is expected this will be expunged "
+                        "by the next daily task some time after %s, "
+                        "%d hours ago"
+                        % (time.ctime(expunge_time), delta // (60 * 60)))
+        else:
+            self.report("SKIPPING: object %s is an expired tombstone" % dn)
+            self.report("INFO: it was expected this object would have "
+                        "been expunged soon after"
+                        "%s, %d days ago"
+                        % (time.ctime(expunge_time), delta_days))
+
         self.report("isDeleted: attid=0x%08x version=%d invocation=%s usn=%s (local=%s) at %s" % (
                     isDeleted.attid,
                     isDeleted.version,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index ffee1d51e5f..64033043675 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -833,7 +833,8 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
 
 	status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
 	if (!NT_STATUS_IS_OK(status)) {
-		return false;
+		ret = 1;
+		goto done;
 	}
 
 	status = SMB_VFS_CREATE_FILE(
@@ -892,7 +893,9 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
 
 	status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
 	if (!NT_STATUS_IS_OK(status)) {
-		return false;
+		DBG_NOTICE("Can't open new file [%s], errno = %d\n",
+			   smb_fname_str_dbg(smb_fname), errno);
+		goto error_exit;
 	}
 
 	status = SMB_VFS_CREATE_FILE(
@@ -1101,7 +1104,10 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
 
 	nt_status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
 	if (!NT_STATUS_IS_OK(nt_status)) {
-		return false;
+		DBG_NOTICE("Can't open file [%s], errno =%d\n",
+			   smb_fname_str_dbg(smb_fname), errno);
+		*perr = WERR_ACCESS_DENIED;
+		goto error_exit;
 	}
 
 	nt_status = SMB_VFS_CREATE_FILE(
diff --git a/source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user3.txt b/source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user3.txt
index d014bfacae2..ea9b630df08 100644
--- a/source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user3.txt
+++ b/source4/selftest/provisions/release-4-5-0-pre1/expected-dbcheck-link-output-lost-deleted-user3.txt
@@ -1,19 +1,19 @@
 Checking 232 objects
-SKIPING: object CN=fred\0ADEL:2301a64c-1122-5566-851e-12d4a711cfb4,OU=removed,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=fred\0ADEL:2301a64c-1122-5566-851e-12d4a711cfb4,OU=removed,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3746 (local=3746) at Wed Jun 29 04:36:39 2016
-SKIPING: object CN=fred\0ADEL:2301a64c-5b42-4ca8-851e-12d4a711cfb4,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=fred\0ADEL:2301a64c-5b42-4ca8-851e-12d4a711cfb4,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3746 (local=3746) at Wed Jun 29 04:36:39 2016
-SKIPING: object CN=dsg\0ADEL:6d66d0ef-cad7-4e5d-b1b6-4a233a21c269,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=dsg\0ADEL:6d66d0ef-cad7-4e5d-b1b6-4a233a21c269,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3734 (local=3734) at Wed Jun 29 04:34:32 2016
-SKIPING: object CN=udg\0ADEL:7cff5537-51b1-4d26-a295-0225dbea8525,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=udg\0ADEL:7cff5537-51b1-4d26-a295-0225dbea8525,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3739 (local=3739) at Wed Jun 29 04:34:34 2016
-SKIPING: object CN=usg\0ADEL:d012e8f5-a4bd-40ea-a2a1-68ff2508847d,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=usg\0ADEL:d012e8f5-a4bd-40ea-a2a1-68ff2508847d,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3736 (local=3736) at Wed Jun 29 04:34:33 2016
-SKIPING: object CN=ddg\0ADEL:fb8c2fe3-5448-43de-99f9-e1d3b9357cfc,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=ddg\0ADEL:fb8c2fe3-5448-43de-99f9-e1d3b9357cfc,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3737 (local=3737) at Wed Jun 29 04:34:34 2016
-SKIPING: object CN=gsg\0ADEL:91aa85cc-fc19-4b8c-9fc7-aaba425439c7,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=gsg\0ADEL:91aa85cc-fc19-4b8c-9fc7-aaba425439c7,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3735 (local=3735) at Wed Jun 29 04:34:33 2016
-SKIPING: object CN=gdg\0ADEL:e0f581e7-14ee-4fc2-839c-8f46f581c72a,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
+SKIPPING: object CN=gdg\0ADEL:e0f581e7-14ee-4fc2-839c-8f46f581c72a,CN=Deleted Objects,DC=release-4-5-0-pre1,DC=samba,DC=corp is an expired tombstone
 isDeleted: attid=0x00020030 version=1 invocation=4e4496a3-7fb8-4f97-8a33-d238db8b5e2d usn=3738 (local=3738) at Wed Jun 29 04:34:34 2016
 NOTICE: found 8 expired tombstones, 'samba' will remove them daily, 'samba-tool domain tombstones expunge' would do that immediately.
 Checked 232 objects (0 errors)
diff --git a/testprogs/blackbox/dbcheck-links.sh b/testprogs/blackbox/dbcheck-links.sh
index ead59d691e0..f00fe46c2de 100755
--- a/testprogs/blackbox/dbcheck-links.sh
+++ b/testprogs/blackbox/dbcheck-links.sh
@@ -42,7 +42,7 @@ dbcheck() {
     if [ "$?" != "$2" ]; then
 	return 1
     fi
-    sort $tmpfile > $tmpfile.sorted
+    sort $tmpfile | grep -v "^INFO:" > $tmpfile.sorted
     sort $release_dir/expected-dbcheck-link-output${1}.txt > $tmpfile.expected
     diff -u $tmpfile.sorted $tmpfile.expected
     if [ "$?" != "0" ]; then
diff --git a/testprogs/blackbox/dbcheck-oldrelease.sh b/testprogs/blackbox/dbcheck-oldrelease.sh
index 9e9924654be..64c08c57981 100755
--- a/testprogs/blackbox/dbcheck-oldrelease.sh
+++ b/testprogs/blackbox/dbcheck-oldrelease.sh
@@ -297,6 +297,17 @@ dbcheck_objectclass() {
     fi
 }
 
+# This should 'fail', because it returns the number of wrong records, which it must if we did not skip the deleted objects
+dbcheck_deleted_objects() {
+    if [ x$RELEASE = x"alpha13" ]; then
+	basedn=$($ldbsearch -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb -s base -b "" defaultNamingContext| grep -i defaultNamingContext| cut -d\  -f 2)
+
+	$PYTHON $BINDIR/samba-tool dbcheck -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb "cn=deleted objects,$basedn" --scope base $@
+    else
+	return 1
+    fi
+}
+
 # This should 'fail', because it returns the number of modified records
 dbcheck() {
        $PYTHON $BINDIR/samba-tool dbcheck --selftest-check-expired-tombstones --cross-ncs --fix --yes -H tdb://$PREFIX_ABS/${RELEASE}/private/sam.ldb $@
@@ -488,6 +499,7 @@ testit $RELEASE undump || failed=`expr $failed + 1`
 testit "reindex" reindex || failed=`expr $failed + 1`
 testit "current_version_mod" do_current_version_mod || failed=`expr $failed + 1`
 testit "check_expected_before_values" check_expected_before_values || failed=`expr $failed + 1`
+testit_expect_failure "dbcheck_deleted_objects" dbcheck_deleted_objects || failed=`expr $failed + 1`
 testit_expect_failure "dbcheck_objectclass" dbcheck_objectclass || failed=`expr $failed + 1`
 testit_expect_failure "dbcheck" dbcheck || failed=`expr $failed + 1`
 testit "check_expected_after_values" check_expected_after_values || failed=`expr $failed + 1`


-- 
Samba Shared Repository



More information about the samba-cvs mailing list