summaryrefslogtreecommitdiff
path: root/source4/torture/unix
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-12 13:32:37 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-19 04:04:20 +0200
commitfaa9b2e1b1c6a02add3295f4b2b61b887b017ded (patch)
treeb795782403a17b7ac6baa4cd429afc02fba93b51 /source4/torture/unix
parent624f11e4b46884c13056709ba6abc8dc2a659bc3 (diff)
downloadsamba-faa9b2e1b1c6a02add3295f4b2b61b887b017ded.tar.gz
samba-faa9b2e1b1c6a02add3295f4b2b61b887b017ded.tar.bz2
samba-faa9b2e1b1c6a02add3295f4b2b61b887b017ded.zip
s4-torture: Move check of map-to-guest above SID list check
This makes it easier to interpret failing output. Andrew Bartlett
Diffstat (limited to 'source4/torture/unix')
-rw-r--r--source4/torture/unix/whoami.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c
index 968af6b4a2..7778776442 100644
--- a/source4/torture/unix/whoami.c
+++ b/source4/torture/unix/whoami.c
@@ -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: