mirror of
https://github.com/samba-team/samba.git
synced 2025-02-24 13:57:43 +03:00
s4-torture: Move check of map-to-guest above SID list check
This makes it easier to interpret failing output. Andrew Bartlett
This commit is contained in:
parent
624f11e4b4
commit
faa9b2e1b1
@ -357,6 +357,19 @@ bool torture_unix_whoami(struct torture_context *torture)
|
||||
cli, &whoami, 0xFFFF), ret, fail,
|
||||
"calling SMB_QFS_POSIX_WHOAMI on an authenticated connection");
|
||||
|
||||
/* Check that our anonymous login mapped us to guest on the server, but
|
||||
* only if the server supports this.
|
||||
*/
|
||||
if (whoami.mapping_mask & SMB_WHOAMI_GUEST) {
|
||||
bool guest = whoami.mapping_flags & SMB_WHOAMI_GUEST;
|
||||
torture_comment(torture, "checking whether we were logged in as guest... %s\n",
|
||||
guest ? "YES" : "NO");
|
||||
torture_assert(torture, cli_credentials_is_anonymous(cmdline_credentials) == guest,
|
||||
"login did not credentials map to guest");
|
||||
} else {
|
||||
torture_comment(torture, "server does not support SMB_WHOAMI_GUEST flag\n");
|
||||
}
|
||||
|
||||
addc = torture_setting_string(torture, "addc", NULL);
|
||||
host = torture_setting_string(torture, "host", NULL);
|
||||
|
||||
@ -385,19 +398,6 @@ bool torture_unix_whoami(struct torture_context *torture)
|
||||
|
||||
smbcli_tdis(cli);
|
||||
|
||||
/* Check that our anonymous login mapped us to guest on the server, but
|
||||
* only if the server supports this.
|
||||
*/
|
||||
if (whoami.mapping_mask & SMB_WHOAMI_GUEST) {
|
||||
bool guest = whoami.mapping_flags & SMB_WHOAMI_GUEST;
|
||||
printf("checking whether we were logged in as guest... %s\n",
|
||||
guest ? "YES" : "NO");
|
||||
torture_assert(torture, cli_credentials_is_anonymous(cmdline_credentials) == guest,
|
||||
"login did not credentials map to guest");
|
||||
} else {
|
||||
printf("server does not support SMB_WHOAMI_GUEST flag\n");
|
||||
}
|
||||
|
||||
return true;
|
||||
fail:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user