From: Jeremy Allison Date: Fri, 23 Jun 2017 18:12:22 +0000 (-0700) Subject: s3: smbd: Add regression test for non-wide symlinks to directories fail over SMB3. X-Git-Tag: samba-4.5.11~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb6c6c6353c4c0c0af91d55bb21c7069947572fe;p=thirdparty%2Fsamba.git s3: smbd: Add regression test for non-wide symlinks to directories fail over SMB3. Mark as knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12860 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme (cherry picked from commit f1f388ef80a6516c2f44b7778420f8ffe28c6471) --- diff --git a/selftest/knownfail b/selftest/knownfail index 17667cd29d0..84e2640fa19 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -290,3 +290,4 @@ ^samba4.drs.ridalloc_exop.python.*ridalloc_exop.DrsReplicaSyncTestCase.test_join_time_ridalloc ^samba4.drs.ridalloc_exop.python.*ridalloc_exop.DrsReplicaSyncTestCase.test_rid_set_dbcheck_after_seize ^samba4.drs.ridalloc_exop.python.*ridalloc_exop.DrsReplicaSyncTestCase.test_rid_set_dbcheck ++^samba3.blackbox.smbclient_s3.*follow local symlinks.* diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 1421b91961a..48a8973357f 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1300,6 +1300,9 @@ sub provision($$$$$$$$) my $nosymlinks_shrdir="$shrdir/nosymlinks"; push(@dirs,$nosymlinks_shrdir); + my $local_symlinks_shrdir="$shrdir/local_symlinks"; + push(@dirs,$local_symlinks_shrdir); + # this gets autocreated by winbindd my $wbsockdir="$prefix_abs/winbindd"; my $wbsockprivdir="$lockdir/winbindd_privileged"; @@ -1925,6 +1928,10 @@ sub provision($$$$$$$$) copy = tmp path = $nosymlinks_shrdir follow symlinks = no +[local_symlinks] + copy = tmp + path = $local_symlinks_shrdir + follow symlinks = yes [kernel_oplocks] copy = tmp kernel oplocks = yes diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index be7aafbed7c..ce1cb089ea9 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -1215,6 +1215,57 @@ EOF fi } +# Test we can follow normal symlinks. +# Bug: https://bugzilla.samba.org/show_bug.cgi?id=12860 +# Note - this needs to be tested over SMB3, not SMB1. + +test_local_symlinks() +{ +# Setup test dirs. + LOCAL_RAWARGS="${CONFIGURATION} -mSMB3" + LOCAL_ADDARGS="${LOCAL_RAWARGS} $*" + + test_dir="$LOCAL_PATH/local_symlinks/test" + + slink_name="$test_dir/sym_name" + slink_target_dir="$test_dir/dir1" + + rm -rf $test_dir + + mkdir -p $test_dir + mkdir $slink_target_dir + ln -s $slink_target_dir $slink_name + +# Can we cd into the symlink name and ls ? + tmpfile=$PREFIX/smbclient_interactive_prompt_commands + cat > $tmpfile <