summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: