self.assertEqual(syml, ('bar', 'bar', 0, 1));
+ def test_bug15505(self):
+ """Test an absolute intermediate symlink inside the share"""
+ (smb1,smb2) = self.connections(smb1share="tmp",smb2share="tmp")
+ symlink="syml"
+
+ localpath=samba.tests.env_get_var_value("LOCAL_PATH")
+
+ smb1.mkdir("sub")
+ self.addCleanup(self.clean_file, smb1, "sub")
+
+ self.create_symlink(smb1, f'{localpath}/sub1', "sub/lnk")
+ self.addCleanup(self.clean_file, smb1, "sub/lnk")
+
+ smb1.mkdir("sub1")
+ self.addCleanup(self.clean_file, smb1, "sub1")
+
+ fd = smb1.create("sub1/x", CreateDisposition=libsmb.FILE_CREATE);
+ smb1.close(fd)
+ self.addCleanup(self.clean_file, smb1, "sub1/x")
+
+ fd = smb2.create("sub\\lnk\\x")
+ smb2.close(fd)
+
if __name__ == '__main__':
import unittest
unittest.main()
return
fi
- # Create a file to be accessed behind the symlink
- touch $local_slink_target_dir/x
- ret=$?
- if [ $ret -ne 0 ]; then
- echo "$out"
- echo "failed - unable to create file"
- ls -la $local_test_dir
- false
- return
- fi
-
# Can we cd into the symlink name and ls ?
tmpfile=$PREFIX/smbclient_interactive_prompt_commands
cat >$tmpfile <<EOF
return
fi
- # Can we get the test file behind the symlink'ed dir?
- tmpfile=$PREFIX/smbclient_interactive_prompt_commands
- cat >$tmpfile <<EOF
-get $share_test_dir\\sym_name\\x -
-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
-
# CLEANUP
rm -f $local_slink_name