From faa9b2e1b1c6a02add3295f4b2b61b887b017ded Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 12 Jul 2012 13:32:37 +1000 Subject: s4-torture: Move check of map-to-guest above SID list check This makes it easier to interpret failing output. Andrew Bartlett --- source4/torture/unix/whoami.c | 26 +++++++++++++------------- 1 file 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: -- cgit