mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: torture: Add regression test for bug #11249.
Bug 11249 - Mangled names do not work with acl_xattr BUG: https://bugzilla.samba.org/show_bug.cgi?id=11249 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue May 5 16:37:18 CEST 2015 on sn-devel-104
This commit is contained in:
parent
0f23bf228c
commit
9928d9832c
@ -980,6 +980,9 @@ sub provision($$$$$$$$)
|
||||
my $lease2_shrdir="$shrdir/SMB3_00";
|
||||
push(@dirs,$lease2_shrdir);
|
||||
|
||||
my $manglenames_shrdir="$shrdir/manglenames";
|
||||
push(@dirs,$manglenames_shrdir);
|
||||
|
||||
# this gets autocreated by winbindd
|
||||
my $wbsockdir="$prefix_abs/winbindd";
|
||||
my $wbsockprivdir="$lockdir/winbindd_privileged";
|
||||
@ -1063,6 +1066,12 @@ sub provision($$$$$$$$)
|
||||
close(BADNAME_TARGET);
|
||||
chmod 0666, $badname_target;
|
||||
|
||||
##
|
||||
## create mangleable directory names in $manglenames_shrdir
|
||||
##
|
||||
my $manglename_target = "$manglenames_shrdir/foo:bar";
|
||||
mkdir($manglename_target, 0777);
|
||||
|
||||
my $conffile="$libdir/server.conf";
|
||||
|
||||
my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/lib/nss_wrapper/nss_wrapper.pl";
|
||||
@ -1338,6 +1347,10 @@ sub provision($$$$$$$$)
|
||||
path = $badnames_shrdir
|
||||
guest ok = yes
|
||||
|
||||
[manglenames_share]
|
||||
path = $manglenames_shrdir
|
||||
guest ok = yes
|
||||
|
||||
[dynamic_share]
|
||||
path = $shrdir/%R
|
||||
guest ok = yes
|
||||
|
@ -863,6 +863,40 @@ test_bad_names()
|
||||
fi
|
||||
}
|
||||
|
||||
# Test accessing an share with a name that must be mangled - with acl_xattrs.
|
||||
# We know foo:bar gets mangled to FF4GBY~Q with the default name-mangling algorithm (hash2).
|
||||
test_mangled_names()
|
||||
{
|
||||
tmpfile=$PREFIX/smbclient_interactive_prompt_commands
|
||||
cat > $tmpfile <<EOF
|
||||
ls
|
||||
cd FF4GBY~Q
|
||||
ls
|
||||
quit
|
||||
EOF
|
||||
cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/manglenames_share -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
|
||||
eval echo "$cmd"
|
||||
out=`eval $cmd`
|
||||
ret=$?
|
||||
rm -f $tmpfile
|
||||
|
||||
if [ $ret != 0 ] ; then
|
||||
echo "$out"
|
||||
echo "failed accessing manglenames_share with error $ret"
|
||||
false
|
||||
return
|
||||
fi
|
||||
|
||||
echo "$out" | grep 'NT_STATUS'
|
||||
ret=$?
|
||||
if [ $ret == 0 ] ; then
|
||||
echo "$out"
|
||||
echo "failed - NT_STATUS_XXXX listing \\manglenames_share\\FF4GBY~Q"
|
||||
false
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
LOGDIR_PREFIX=test_smbclient_s3
|
||||
|
||||
# possibly remove old logdirs:
|
||||
@ -942,6 +976,10 @@ testit "list a share with bad names (won't convert)" \
|
||||
test_bad_names || \
|
||||
failed=`expr $failed + 1`
|
||||
|
||||
testit "list a share with a mangled name + acl_xattr object" \
|
||||
test_mangled_names || \
|
||||
failed=`expr $failed + 1`
|
||||
|
||||
testit "rm -rf $LOGDIR" \
|
||||
rm -rf $LOGDIR || \
|
||||
failed=`expr $failed + 1`
|
||||
|
Loading…
Reference in New Issue
Block a user