summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-10 14:31:52 +1100
committerAndrew Tridgell <tridge@samba.org>2009-12-10 17:51:28 +1100
commit33cbe9c6310a7853a0189cd17b0f6c26f208cf16 (patch)
tree5a9ae007729250327ed32690da268f6567709c6d /source4
parent1b20002cc246f6bab6fe2369412bd4c65311785f (diff)
downloadsamba-33cbe9c6310a7853a0189cd17b0f6c26f208cf16.tar.gz
samba-33cbe9c6310a7853a0189cd17b0f6c26f208cf16.tar.bz2
samba-33cbe9c6310a7853a0189cd17b0f6c26f208cf16.zip
s4-server: use GUID_to_ndr_blob() in cldap and smb servers
Diffstat (limited to 'source4')
-rw-r--r--source4/cldap_server/netlogon.c8
-rw-r--r--source4/smb_server/blob.c10
-rw-r--r--source4/smb_server/smb2/negprot.c5
3 files changed, 9 insertions, 14 deletions
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c
index 049b0085b3..7072953121 100644
--- a/source4/cldap_server/netlogon.c
+++ b/source4/cldap_server/netlogon.c
@@ -104,7 +104,6 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
if (domain_guid) {
struct GUID binary_guid;
struct ldb_val guid_val;
- enum ndr_err_code ndr_err;
/* By this means, we ensure we don't have funny stuff in the GUID */
@@ -114,10 +113,9 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
}
/* And this gets the result into the binary format we want anyway */
- ndr_err = ndr_push_struct_blob(&guid_val, mem_ctx, NULL, &binary_guid,
- (ndr_push_flags_fn_t)ndr_push_GUID);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- return NT_STATUS_INVALID_PARAMETER;
+ status = GUID_to_ndr_blob(&binary_guid, mem_ctx, &guid_val);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
ret = ldb_search(sam_ctx, mem_ctx, &dom_res,
NULL, LDB_SCOPE_SUBTREE,
diff --git a/source4/smb_server/blob.c b/source4/smb_server/blob.c
index bf8985ccdf..182c803f96 100644
--- a/source4/smb_server/blob.c
+++ b/source4/smb_server/blob.c
@@ -272,15 +272,13 @@ NTSTATUS smbsrv_push_passthru_fsinfo(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
case RAW_QFS_OBJECTID_INFORMATION: {
- enum ndr_err_code ndr_err;
+ NTSTATUS status;
BLOB_CHECK(smbsrv_blob_grow_data(mem_ctx, blob, 64));
- ndr_err = ndr_push_struct_blob(&guid_blob, mem_ctx, NULL,
- &fsinfo->objectid_information.out.guid,
- (ndr_push_flags_fn_t)ndr_push_GUID);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- BLOB_CHECK(ndr_map_error2ntstatus(ndr_err));
+ status = GUID_to_ndr_blob(&fsinfo->objectid_information.out.guid, mem_ctx, &guid_blob);
+ if (!NT_STATUS_IS_OK(status)) {
+ BLOB_CHECK(status);
}
memcpy(blob->data, guid_blob.data, guid_blob.length);
diff --git a/source4/smb_server/smb2/negprot.c b/source4/smb_server/smb2/negprot.c
index faf025a1f8..260822f2c5 100644
--- a/source4/smb_server/smb2/negprot.c
+++ b/source4/smb_server/smb2/negprot.c
@@ -153,7 +153,6 @@ static NTSTATUS smb2srv_negprot_backend(struct smb2srv_request *req, struct smb2
static void smb2srv_negprot_send(struct smb2srv_request *req, struct smb2_negprot *io)
{
NTSTATUS status;
- enum ndr_err_code ndr_err;
if (NT_STATUS_IS_ERR(req->status)) {
smb2srv_send_error(req, req->status); /* TODO: is this correct? */
@@ -170,8 +169,8 @@ static void smb2srv_negprot_send(struct smb2srv_request *req, struct smb2_negpro
SSVAL(req->out.body, 0x02, io->out.security_mode);
SIVAL(req->out.body, 0x04, io->out.dialect_revision);
SIVAL(req->out.body, 0x06, io->out.reserved);
- ndr_err = smbcli_push_guid(req->out.body, 0x08, &io->out.server_guid);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ status = smbcli_push_guid(req->out.body, 0x08, &io->out.server_guid);
+ if (!NT_STATUS_IS_OK(status)) {
smbsrv_terminate_connection(req->smb_conn, nt_errstr(status));
talloc_free(req);
return;