diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-11-09 19:24:51 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:45:02 +0100 |
commit | 529763a9aa192a6785ba878aceeb1683c2510913 (patch) | |
tree | 5fc843ffa644969ecd967d8b4133fc19333c33b5 /source4/libcli/raw | |
parent | b2ddeeb79d2622b3fd216465716dfa6b8c3e0b86 (diff) | |
download | samba-529763a9aa192a6785ba878aceeb1683c2510913.tar.gz samba-529763a9aa192a6785ba878aceeb1683c2510913.tar.xz samba-529763a9aa192a6785ba878aceeb1683c2510913.zip |
r25920: ndr: change NTSTAUS into enum ndr_err_code (samba4 callers)
lib/messaging/
lib/registry/
lib/ldb-samba/
librpc/rpc/
auth/auth_winbind.c
auth/gensec/
auth/kerberos/
dsdb/repl/
dsdb/samdb/
dsdb/schema/
torture/
cluster/ctdb/
kdc/
ntvfs/ipc/
torture/rap/
ntvfs/
utils/getntacl.c
ntptr/
smb_server/
libcli/wrepl/
wrepl_server/
libcli/cldap/
libcli/dgram/
libcli/ldap/
libcli/raw/
libcli/nbt/
libnet/
winbind/
rpc_server/
metze
(This used to be commit 6223c7fddc972687eb577e04fc1c8e0604c35435)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/rawacl.c | 16 | ||||
-rw-r--r-- | source4/libcli/raw/rawfile.c | 10 | ||||
-rw-r--r-- | source4/libcli/raw/rawfileinfo.c | 12 | ||||
-rw-r--r-- | source4/libcli/raw/rawfsinfo.c | 8 | ||||
-rw-r--r-- | source4/libcli/raw/rawsetfileinfo.c | 14 |
5 files changed, 36 insertions, 24 deletions
diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c index 168f9c03096..0f2fdb60af5 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 83303cf470d..c34cb9c52f3 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 8481995c1a0..17e1792fe34 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 ced977333de..73f1192df06 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 5fa0c1f2da0..3ae2a2dd205 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; } |