summaryrefslogtreecommitdiff
path: root/source4/torture/unix
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-06-24 18:16:48 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-06-24 23:46:10 +1000
commit0eab44c2978553bda303c43875d626fddf32363d (patch)
treef37a541b7a329e3d5d5c4559d92839d90cceb718 /source4/torture/unix
parentf199c5dbc09912a185feda5aa87dc82e2800ad6a (diff)
downloadsamba-0eab44c2978553bda303c43875d626fddf32363d.tar.gz
samba-0eab44c2978553bda303c43875d626fddf32363d.tar.bz2
samba-0eab44c2978553bda303c43875d626fddf32363d.zip
selftest: Test unix.whoami with kerberos on plugin_s4_dc
This also tests the comparison with LDAP on anonymous connections and marks this as knownfail, while we investigate the correct behaviour here. Andrew Bartlett
Diffstat (limited to 'source4/torture/unix')
-rw-r--r--source4/torture/unix/whoami.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c
index 302282752a..8f608a8f67 100644
--- a/source4/torture/unix/whoami.c
+++ b/source4/torture/unix/whoami.c
@@ -297,7 +297,6 @@ static bool test_against_ldap(struct torture_context *torture, struct ldb_contex
bool torture_unix_whoami(struct torture_context *torture)
{
struct smbcli_state *cli;
- struct cli_credentials *anon_credentials;
struct smb_whoami whoami;
bool ret;
struct ldb_context *ldb;
@@ -335,26 +334,15 @@ bool torture_unix_whoami(struct torture_context *torture)
smbcli_tdis(cli);
- torture_comment(torture, "calling SMB_QFS_POSIX_WHOAMI on an anonymous connection\n");
- anon_credentials = cli_credentials_init_anon(torture);
-
- cli = connect_to_server(torture, anon_credentials);
- torture_assert(torture, cli, "calling SMB_QFS_POSIX_WHOAMI on an anonymous connection");
-
- torture_assert_goto(torture, smb_raw_query_posix_whoami(torture, torture,
- cli, &whoami, 0xFFFF), ret, fail,
- "calling SMB_QFS_POSIX_WHOAMI on an anonymous connection");
-
- 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",
- whoami.mapping_flags & SMB_WHOAMI_GUEST ? "YES" : "NO");
- torture_assert(torture, whoami.mapping_flags & SMB_WHOAMI_GUEST,
- "anonymous login did not map to guest");
+ 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");
}