]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add regression test for non-wide symlinks to directories fail over SMB3.
authorJeremy Allison <jra@samba.org>
Fri, 23 Jun 2017 18:12:22 +0000 (11:12 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 28 Jun 2017 09:20:08 +0000 (11:20 +0200)
Mark as knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12860

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit f1f388ef80a6516c2f44b7778420f8ffe28c6471)

selftest/knownfail
selftest/target/Samba3.pm
source3/script/tests/test_smbclient_s3.sh

index 17667cd29d0418a1ebbe4f3aa2a29b69afb9dfd0..84e2640fa1942e405e5280a45246a769da7d0db6 100644 (file)
 ^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.*
index 1421b91961a2eeeaa275bbbd683b9c25984df10b..48a8973357fc57e48a89b9562bbbcd1d80d93122 100755 (executable)
@@ -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
index be7aafbed7c90ada7f7e18419f045233e991e9f3..ce1cb089ea9e1247d9a1693ed70daa486bc580e6 100755 (executable)
@@ -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 <<EOF
+cd test\\sym_name
+ls
+quit
+EOF
+    cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/local_symlinks -I $SERVER_IP $LOCAL_ADDARGS < $tmpfile 2>&1'
+    eval echo "$cmd"
+    out=`eval $cmd`
+    ret=$?
+    rm -f $tmpfile
+
+    if [ $ret -ne 0 ] ; then
+       echo "$out"
+       echo "failed accessing local_symlinks with error $ret"
+       false
+       return
+    fi
+
+    echo "$out" | grep 'NT_STATUS_'
+    ret=$?
+    if [ $ret -eq 0 ] ; then
+       echo "$out"
+       echo "failed - got an NT_STATUS error"
+       false
+       return
+    fi
+}
+
 LOGDIR_PREFIX=test_smbclient_s3
 
 # possibly remove old logdirs:
@@ -1318,6 +1369,10 @@ testit "follow symlinks = no" \
     test_nosymlinks || \
     failed=`expr $failed + 1`
 
+testit "follow local symlinks" \
+    test_local_symlinks || \
+    failed=`expr $failed + 1`
+
 testit "rm -rf $LOGDIR" \
     rm -rf $LOGDIR || \
     failed=`expr $failed + 1`