mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
s3:tests: Add substitution test for include directive
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15243 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
parent
26adf33443
commit
ce3d27a9f5
@ -2680,6 +2680,8 @@ sub provision($$)
|
||||
my $errorinjectconf="$libdir/error_inject.conf";
|
||||
my $delayinjectconf="$libdir/delay_inject.conf";
|
||||
my $globalinjectconf="$libdir/global_inject.conf";
|
||||
my $aliceconfdir="$libdir";
|
||||
my $aliceconffile="$libdir/alice.conf";
|
||||
|
||||
my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/third_party/nss_wrapper/nss_wrapper.pl";
|
||||
my $nss_wrapper_passwd = "$privatedir/passwd";
|
||||
@ -3461,6 +3463,8 @@ sub provision($$)
|
||||
[only_ipv6]
|
||||
copy = tmpguest
|
||||
server addresses = $server_ipv6
|
||||
|
||||
include = $aliceconfdir/%U.conf
|
||||
";
|
||||
|
||||
close(CONF);
|
||||
@ -3501,6 +3505,19 @@ sub provision($$)
|
||||
}
|
||||
close(DELAYCONF);
|
||||
|
||||
unless (open(ALICECONF, ">$aliceconffile")) {
|
||||
warn("Unable to open $aliceconffile");
|
||||
return undef;
|
||||
}
|
||||
|
||||
print ALICECONF "
|
||||
[alice_share]
|
||||
path = $shrdir
|
||||
comment = smb username is [%U]
|
||||
";
|
||||
|
||||
close(ALICECONF);
|
||||
|
||||
##
|
||||
## create a test account
|
||||
##
|
||||
|
@ -49,4 +49,14 @@ SMB_UNC="//$SERVER/sub_valid_users_group"
|
||||
test_smbclient "Test login to share with substitution for valid user's UNIX group" \
|
||||
"ls" "$SMB_UNC" "-U$USERNAME%$PASSWORD" || failed=$(expr $failed + 1)
|
||||
|
||||
test_smbclient \
|
||||
"Test for login to share with include substitution [${USERNAME}]" \
|
||||
"ls" "//${SERVER}/${USERNAME}_share" "-U$USERNAME%$PASSWORD" ||
|
||||
failed=$((failed + 1))
|
||||
|
||||
test_smbclient_expect_failure \
|
||||
"Netative test for login to share with include substitution [${DC_USERNAME}]" \
|
||||
"ls" "//${SERVER}/${USERNAME}_share" "-U$DC_USERNAME%$DC_PASSWORD" ||
|
||||
failed=$((failed + 1))
|
||||
|
||||
exit $failed
|
||||
|
Loading…
x
Reference in New Issue
Block a user