diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-12-10 14:32:15 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-12-10 17:51:28 +1100 |
commit | b4ea96ecd9bab32d06599d872f091576e31e12f8 (patch) | |
tree | 2c4bf5ec7f91bbcb2488f372a3e711fa51208636 /source4/libcli | |
parent | 33cbe9c6310a7853a0189cd17b0f6c26f208cf16 (diff) | |
download | samba-b4ea96ecd9bab32d06599d872f091576e31e12f8.tar.gz samba-b4ea96ecd9bab32d06599d872f091576e31e12f8.tar.bz2 samba-b4ea96ecd9bab32d06599d872f091576e31e12f8.zip |
s4-libcli: use GUID_to_ndr_blob()
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/raw/rawrequest.c | 14 | ||||
-rw-r--r-- | source4/libcli/smb2/negprot.c | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index 723e3d909c..52b9bf74bf 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -1007,19 +1007,17 @@ NTSTATUS smbcli_pull_guid(void *base, uint16_t offset, /* push a guid onto the wire. The buffer must hold 16 bytes */ -enum ndr_err_code smbcli_push_guid(void *base, uint16_t offset, - const struct GUID *guid) +NTSTATUS smbcli_push_guid(void *base, uint16_t offset, const struct GUID *guid) { TALLOC_CTX *tmp_ctx = talloc_new(NULL); - enum ndr_err_code ndr_err; + NTSTATUS status; DATA_BLOB blob; - ndr_err = ndr_push_struct_blob(&blob, tmp_ctx, NULL, - guid, (ndr_push_flags_fn_t)ndr_push_GUID); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err) || blob.length != 16) { + status = GUID_to_ndr_blob(guid, tmp_ctx, &blob); + if (!NT_STATUS_IS_OK(status)) { talloc_free(tmp_ctx); - return ndr_err; + return status; } memcpy(offset + (uint8_t *)base, blob.data, blob.length); talloc_free(tmp_ctx); - return ndr_err; + return NT_STATUS_OK; } diff --git a/source4/libcli/smb2/negprot.c b/source4/libcli/smb2/negprot.c index 16dcd1571f..1ff4193499 100644 --- a/source4/libcli/smb2/negprot.c +++ b/source4/libcli/smb2/negprot.c @@ -34,8 +34,8 @@ struct smb2_request *smb2_negprot_send(struct smb2_transport *transport, { struct smb2_request *req; uint16_t size = 0x24 + io->in.dialect_count*2; - enum ndr_err_code ndr_err; int i; + NTSTATUS status; req = smb2_request_init(transport, SMB2_OP_NEGPROT, size, false, 0); if (req == NULL) return NULL; @@ -46,8 +46,8 @@ struct smb2_request *smb2_negprot_send(struct smb2_transport *transport, SSVAL(req->out.body, 0x04, io->in.security_mode); SSVAL(req->out.body, 0x06, io->in.reserved); SIVAL(req->out.body, 0x08, io->in.capabilities); - ndr_err = smbcli_push_guid(req->out.body, 0x0C, &io->in.client_guid); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { + status = smbcli_push_guid(req->out.body, 0x0C, &io->in.client_guid); + if (!NT_STATUS_IS_OK(status)) { talloc_free(req); return NULL; } |