[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Jan 2 20:38:02 UTC 2024


The branch, master has been updated
       via  2cfbf43f706 smbd: Fix traversing snapshot dirs that vanished in current fileset
       via  a0bfadb32b8 shadow_copy: Add test for missing directory in "current" fileset
      from  314eb730833 Happy New Year 2024!

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2cfbf43f706d5d29a5b1a5b13aac0661e42da0b1
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 28 14:38:37 2023 +0100

    smbd: Fix traversing snapshot dirs that vanished in current fileset
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=15544
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Jan  2 20:37:01 UTC 2024 on atb-devel-224

commit a0bfadb32b83ab1e58290f84c298d345e21866d9
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Dec 28 14:20:11 2023 +0100

    shadow_copy: Add test for missing directory in "current" fileset
    
    Right now we can't traverse a subdirectory in a snapshot which was
    deleted in the current set of files.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=15544
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 source3/script/tests/test_shadow_copy.sh | 27 +++++++++++++++++++++++++++
 source3/smbd/filename.c                  |  2 +-
 2 files changed, 28 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/script/tests/test_shadow_copy.sh b/source3/script/tests/test_shadow_copy.sh
index b5726e4b833..3141df3568d 100755
--- a/source3/script/tests/test_shadow_copy.sh
+++ b/source3/script/tests/test_shadow_copy.sh
@@ -389,6 +389,32 @@ test_shadow_copy_format()
         failed=`expr $failed + 1`
 }
 
+# Test fetching a file where there's no current version of it
+test_missing_basedir()
+{
+    local share
+    local where
+    local prefix
+    local snapidx
+
+    share=$1
+    where=$2
+    prefix=$3
+    snapidx=$4
+
+    #delete snapshots from previous tests
+    find $WORKDIR -name ".snapshots" -exec rm -rf {} \; 1>/dev/null 2>&1
+    build_snapshots $WORKDIR/$where "$prefix" "$snapidx" "$snapidx"
+
+    (cd "$WORKDIR/$where"/share; mv bar _bar)
+
+    testit "fetch a file without a latest version" \
+	test_fetch_snap_file "$share" "bar/baz" "$snapidx" || \
+	failed=`expr $failed + 1`
+
+    (cd "$WORKDIR/$where"/share; mv _bar bar)
+}
+
 #build "latest" files
 build_files $WORKDIR/mount base/share "latest" "latest"
 
@@ -423,5 +449,6 @@ test_shadow_copy_format shadow_fmt2 mount/base share 2 "shadow:format with some
 test_shadow_copy_format shadow_fmt3 mount/base share 2 "shadow:format with modified format"
 test_shadow_copy_format shadow_fmt4 mount/base share 3 "shadow:format with snapprefix"
 test_shadow_copy_format shadow_fmt5 mount/base share 6 "shadow:format with delimiter"
+test_missing_basedir shadow3 "mount/base" "share" 6
 
 exit $failed
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 2ec073b2154..e7f5fe29b02 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -839,7 +839,7 @@ static NTSTATUS filename_convert_dirfsp_nosymlink(
 						      conn,
 						      conn->cwd_fsp,
 						      dirname,
-						      0,
+						      twrp,
 						      posix,
 						      &smb_dirname,
 						      &symlink_err);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list