summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-03-16 16:54:31 +0100
committerGünther Deschner <gd@samba.org>2011-03-16 17:47:11 +0100
commit48c2117019845aca56de96feebcd4feb25f3e12d (patch)
tree08ca02cb7d7f38a604347214c31f2e0454565a0f /source4
parent9295cffad882132963a778ef0769316c68ec3e33 (diff)
downloadsamba-48c2117019845aca56de96feebcd4feb25f3e12d.tar.gz
samba-48c2117019845aca56de96feebcd4feb25f3e12d.tar.bz2
samba-48c2117019845aca56de96feebcd4feb25f3e12d.zip
s4-smbtorture: use torture_assert in torture_samba3_rpc_sharesec().
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Mar 16 17:47:11 CET 2011 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/samba3rpc.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index b872d5e7a5..d0de30966c 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -2384,48 +2384,43 @@ bool try_tcon(struct torture_context *tctx,
static bool torture_samba3_rpc_sharesec(struct torture_context *torture)
{
- TALLOC_CTX *mem_ctx;
- bool ret = true;
struct smbcli_state *cli;
struct security_descriptor *sd;
struct dom_sid *user_sid;
- if (!(mem_ctx = talloc_new(torture))) {
- return false;
- }
-
if (!(torture_open_connection_share(
- mem_ctx, &cli, torture, torture_setting_string(torture, "host", NULL),
+ torture, &cli, torture, torture_setting_string(torture, "host", NULL),
"IPC$", torture->ev))) {
- torture_comment(torture, "IPC$ connection failed\n");
- talloc_free(mem_ctx);
- return false;
+ torture_fail(torture, "IPC$ connection failed\n");
}
- if (!(user_sid = whoami(torture, mem_ctx, cli->tree))) {
- torture_comment(torture, "whoami failed\n");
- talloc_free(mem_ctx);
- return false;
+ if (!(user_sid = whoami(torture, torture, cli->tree))) {
+ torture_fail(torture, "whoami failed\n");
}
- sd = get_sharesec(torture, mem_ctx, cli->session,
+ sd = get_sharesec(torture, torture, cli->session,
torture_setting_string(torture, "share", NULL));
- ret &= try_tcon(torture, mem_ctx, sd, cli->session,
+ torture_assert(torture, try_tcon(
+ torture, torture, sd, cli->session,
torture_setting_string(torture, "share", NULL),
- user_sid, 0, NT_STATUS_ACCESS_DENIED, NT_STATUS_OK);
+ user_sid, 0, NT_STATUS_ACCESS_DENIED, NT_STATUS_OK),
+ "failed to test tcon with 0 access_mask");
- ret &= try_tcon(torture, mem_ctx, sd, cli->session,
+ torture_assert(torture, try_tcon(
+ torture, torture, sd, cli->session,
torture_setting_string(torture, "share", NULL),
user_sid, SEC_FILE_READ_DATA, NT_STATUS_OK,
- NT_STATUS_MEDIA_WRITE_PROTECTED);
+ NT_STATUS_MEDIA_WRITE_PROTECTED),
+ "failed to test tcon with SEC_FILE_READ_DATA access_mask");
- ret &= try_tcon(torture, mem_ctx, sd, cli->session,
+ torture_assert(torture, try_tcon(
+ torture, torture, sd, cli->session,
torture_setting_string(torture, "share", NULL),
- user_sid, SEC_FILE_ALL, NT_STATUS_OK, NT_STATUS_OK);
+ user_sid, SEC_FILE_ALL, NT_STATUS_OK, NT_STATUS_OK),
+ "failed to test tcon with SEC_FILE_ALL access_mask")
- talloc_free(mem_ctx);
- return ret;
+ return true;
}
static bool torture_samba3_rpc_lsa(struct torture_context *torture)