summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r--source4/libcli/raw/rawacl.c16
-rw-r--r--source4/libcli/raw/rawfile.c10
-rw-r--r--source4/libcli/raw/rawfileinfo.c12
-rw-r--r--source4/libcli/raw/rawfsinfo.c8
-rw-r--r--source4/libcli/raw/rawsetfileinfo.c14
5 files changed, 36 insertions, 24 deletions
diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c
index 168f9c0309..0f2fdb60af 100644
--- a/source4/libcli/raw/rawacl.c
+++ b/source4/libcli/raw/rawacl.c
@@ -61,6 +61,7 @@ NTSTATUS smb_raw_query_secdesc_recv(struct smbcli_request *req,
NTSTATUS status;
struct smb_nttrans nt;
struct ndr_pull *ndr;
+ enum ndr_err_code ndr_err;
status = smb_raw_nttrans_recv(req, mem_ctx, &nt);
if (!NT_STATUS_IS_OK(status)) {
@@ -84,10 +85,13 @@ NTSTATUS smb_raw_query_secdesc_recv(struct smbcli_request *req,
if (!io->query_secdesc.out.sd) {
return NT_STATUS_NO_MEMORY;
}
- status = ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS,
- io->query_secdesc.out.sd);
+ ndr_err = ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS,
+ io->query_secdesc.out.sd);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ndr_map_error2ntstatus(ndr_err);
+ }
- return status;
+ return NT_STATUS_OK;
}
@@ -114,7 +118,7 @@ struct smbcli_request *smb_raw_set_secdesc_send(struct smbcli_tree *tree,
uint8_t params[8];
struct ndr_push *ndr;
struct smbcli_request *req;
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
nt.in.max_setup = 0;
nt.in.max_param = 0;
@@ -133,8 +137,8 @@ struct smbcli_request *smb_raw_set_secdesc_send(struct smbcli_tree *tree,
ndr = ndr_push_init_ctx(NULL);
if (!ndr) return NULL;
- status = ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, io->set_secdesc.in.sd);
- if (!NT_STATUS_IS_OK(status)) {
+ ndr_err = ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, io->set_secdesc.in.sd);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(ndr);
return NULL;
}
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index 83303cf470..c34cb9c52f 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -263,7 +263,6 @@ static struct smbcli_request *smb_raw_nttrans_create_send(struct smbcli_tree *tr
uint16_t fname_len;
DATA_BLOB sd_blob, ea_blob;
struct smbcli_request *req;
- NTSTATUS status;
nt.in.max_setup = 0;
nt.in.max_param = 101;
@@ -276,10 +275,11 @@ static struct smbcli_request *smb_raw_nttrans_create_send(struct smbcli_tree *tr
ea_blob = data_blob(NULL, 0);
if (parms->ntcreatex.in.sec_desc) {
- status = ndr_push_struct_blob(&sd_blob, mem_ctx,
- parms->ntcreatex.in.sec_desc,
- (ndr_push_flags_fn_t)ndr_push_security_descriptor);
- if (!NT_STATUS_IS_OK(status)) {
+ enum ndr_err_code ndr_err;
+ ndr_err = ndr_push_struct_blob(&sd_blob, mem_ctx,
+ parms->ntcreatex.in.sec_desc,
+ (ndr_push_flags_fn_t)ndr_push_security_descriptor);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
talloc_free(mem_ctx);
return NULL;
}
diff --git a/source4/libcli/raw/rawfileinfo.c b/source4/libcli/raw/rawfileinfo.c
index 8481995c1a..17e1792fe3 100644
--- a/source4/libcli/raw/rawfileinfo.c
+++ b/source4/libcli/raw/rawfileinfo.c
@@ -245,15 +245,17 @@ NTSTATUS smb_raw_fileinfo_passthru_parse(const DATA_BLOB *blob, TALLOC_CTX *mem_
return NT_STATUS_OK;
case RAW_FILEINFO_SEC_DESC: {
- NTSTATUS status;
+ enum ndr_err_code ndr_err;
parms->query_secdesc.out.sd = talloc(mem_ctx, struct security_descriptor);
NT_STATUS_HAVE_NO_MEMORY(parms->query_secdesc.out.sd);
- status = ndr_pull_struct_blob(blob, mem_ctx,
- parms->query_secdesc.out.sd,
- (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
- NT_STATUS_NOT_OK_RETURN(status);
+ ndr_err = ndr_pull_struct_blob(blob, mem_ctx,
+ parms->query_secdesc.out.sd,
+ (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ndr_map_error2ntstatus(ndr_err);
+ }
return NT_STATUS_OK;
}
diff --git a/source4/libcli/raw/rawfsinfo.c b/source4/libcli/raw/rawfsinfo.c
index ced977333d..73f1192df0 100644
--- a/source4/libcli/raw/rawfsinfo.c
+++ b/source4/libcli/raw/rawfsinfo.c
@@ -158,6 +158,7 @@ NTSTATUS smb_raw_fsinfo_passthru_parse(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
union smb_fsinfo *fsinfo)
{
NTSTATUS status = NT_STATUS_OK;
+ enum ndr_err_code ndr_err;
int i;
/* parse the results */
@@ -215,8 +216,11 @@ NTSTATUS smb_raw_fsinfo_passthru_parse(DATA_BLOB blob, TALLOC_CTX *mem_ctx,
case RAW_QFS_OBJECTID_INFORMATION:
QFS_CHECK_SIZE(64);
- status = ndr_pull_struct_blob(&blob, mem_ctx, &fsinfo->objectid_information.out.guid,
- (ndr_pull_flags_fn_t)ndr_pull_GUID);
+ ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &fsinfo->objectid_information.out.guid,
+ (ndr_pull_flags_fn_t)ndr_pull_GUID);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ status = ndr_map_error2ntstatus(ndr_err);
+ }
for (i=0;i<6;i++) {
fsinfo->objectid_information.out.unknown[i] = BVAL(blob.data, 16 + i*8);
}
diff --git a/source4/libcli/raw/rawsetfileinfo.c b/source4/libcli/raw/rawsetfileinfo.c
index 5fa0c1f2da..3ae2a2dd20 100644
--- a/source4/libcli/raw/rawsetfileinfo.c
+++ b/source4/libcli/raw/rawsetfileinfo.c
@@ -86,12 +86,14 @@ bool smb_raw_setfileinfo_passthru(TALLOC_CTX *mem_ctx,
return true;
case RAW_FILEINFO_SEC_DESC: {
- NTSTATUS status;
-
- status = ndr_push_struct_blob(blob, mem_ctx,
- parms->set_secdesc.in.sd,
- (ndr_push_flags_fn_t)ndr_push_security_descriptor);
- if (!NT_STATUS_IS_OK(status)) return false;
+ enum ndr_err_code ndr_err;
+
+ ndr_err = ndr_push_struct_blob(blob, mem_ctx,
+ parms->set_secdesc.in.sd,
+ (ndr_push_flags_fn_t)ndr_push_security_descriptor);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return false;
+ }
return true;
}