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: tdb-1.3.14~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1f388ef80a6516c2f44b7778420f8ffe28c6471;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 --- diff --git a/selftest/knownfail.d/samba3.blackbox.smbclient_s3.follow_local_symlinks b/selftest/knownfail.d/samba3.blackbox.smbclient_s3.follow_local_symlinks new file mode 100644 index 00000000000..7be44c11779 --- /dev/null +++ b/selftest/knownfail.d/samba3.blackbox.smbclient_s3.follow_local_symlinks @@ -0,0 +1 @@ +^samba3.blackbox.smbclient_s3.*follow local symlinks.* diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index d93d98e3af3..6854d7c0ecd 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1355,6 +1355,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"; @@ -1976,6 +1979,11 @@ sub provision($$$$$$$$$) 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 050dd81623e..1c5a13d110f 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 <