summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-23 15:04:25 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-29 15:35:51 +0200
commit12ee027106009664bd6e138df819250e99af5188 (patch)
treea3484f37141c75804bb94f7bffd9d4561ce83c87 /source4
parent10e46e52abde3095d575db39cc3fd60ae6eeb264 (diff)
downloadsamba-12ee027106009664bd6e138df819250e99af5188.tar.gz
samba-12ee027106009664bd6e138df819250e99af5188.tar.bz2
samba-12ee027106009664bd6e138df819250e99af5188.zip
s4:libcli/util/clilsa.c: add explicit check for NTSTATUS r.out.result
Guenther Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/util/clilsa.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c
index fda8aa73b1..50435cf000 100644
--- a/source4/libcli/util/clilsa.c
+++ b/source4/libcli/util/clilsa.c
@@ -125,6 +125,11 @@ static NTSTATUS smblsa_connect(struct smbcli_state *cli)
return status;
}
+ if (!NT_STATUS_IS_OK(r.out.result)) {
+ talloc_free(lsa);
+ return r.out.result;
+ }
+
cli->lsa = lsa;
return NT_STATUS_OK;
@@ -150,7 +155,12 @@ NTSTATUS smblsa_sid_privileges(struct smbcli_state *cli, struct dom_sid *sid,
r.in.sid = sid;
r.out.rights = rights;
- return dcerpc_lsa_EnumAccountRights_r(cli->lsa->pipe->binding_handle, mem_ctx, &r);
+ status = dcerpc_lsa_EnumAccountRights_r(cli->lsa->pipe->binding_handle, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return r.out.result;
}
@@ -239,6 +249,10 @@ NTSTATUS smblsa_lookup_sid(struct smbcli_state *cli,
talloc_free(mem_ctx2);
return status;
}
+ if (!NT_STATUS_IS_OK(r.out.result)) {
+ talloc_free(mem_ctx2);
+ return r.out.result;
+ }
if (names.count != 1) {
talloc_free(mem_ctx2);
return NT_STATUS_UNSUCCESSFUL;
@@ -296,6 +310,10 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli,
talloc_free(mem_ctx2);
return status;
}
+ if (!NT_STATUS_IS_OK(r.out.result)) {
+ talloc_free(mem_ctx2);
+ return r.out.result;
+ }
if (sids.count != 1) {
talloc_free(mem_ctx2);
return NT_STATUS_UNSUCCESSFUL;
@@ -332,7 +350,12 @@ NTSTATUS smblsa_sid_add_privileges(struct smbcli_state *cli, struct dom_sid *sid
r.in.sid = sid;
r.in.rights = rights;
- return dcerpc_lsa_AddAccountRights_r(cli->lsa->pipe->binding_handle, mem_ctx, &r);
+ status = dcerpc_lsa_AddAccountRights_r(cli->lsa->pipe->binding_handle, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return r.out.result;
}
/*
@@ -355,5 +378,10 @@ NTSTATUS smblsa_sid_del_privileges(struct smbcli_state *cli, struct dom_sid *sid
r.in.remove_all = 0;
r.in.rights = rights;
- return dcerpc_lsa_RemoveAccountRights_r(cli->lsa->pipe->binding_handle, mem_ctx, &r);
+ status = dcerpc_lsa_RemoveAccountRights_r(cli->lsa->pipe->binding_handle, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ return r.out.result;
}