r1941: - fixed an allocation error with querying security descriptors remotely
authorAndrew Tridgell <tridge@samba.org>
Fri, 20 Aug 2004 00:03:13 +0000 (00:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:58:12 +0000 (12:58 -0500)
- print the received security_descriptor in the smbclient "acl" command

- make sure we zero the alignment data in nttrans packet sends
(This used to be commit 8925b8b2193905d084e1bfaaa3235ed7f9d1eb55)

source4/client/client.c
source4/libcli/raw/rawacl.c
source4/libcli/raw/rawtrans.c

index 376403917aea4bb9f720e81a84ab460ec4aaee57..f9fbbab6ece21558817807cdf0ba8d7d4588fd88 100644 (file)
@@ -1777,6 +1777,8 @@ static int cmd_acl(void)
                goto done;
        }
 
+       NDR_PRINT_DEBUG(security_descriptor, query.out.sd);
+
        talloc_destroy(mem_ctx);
 
 done:
index dde6b673a0c04f9780d4e53a445661fe8fa616f5..20e6d6df31723d938793337c3388d5f8e237fafa 100644 (file)
@@ -78,7 +78,7 @@ NTSTATUS smb_raw_query_secdesc_recv(struct smbcli_request *req,
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       query->out.sd = talloc(mem_ctx, sizeof(query->out.sd));
+       query->out.sd = talloc_p(mem_ctx, struct security_descriptor);
        if (!query->out.sd) {
                return NT_STATUS_NO_MEMORY;
        }
index 0c39abe8801c8532f46710fc0f4b9173d9381dc5..53f8075822a6b6920e696cf3b086efb5f7b0b094 100644 (file)
@@ -480,6 +480,10 @@ struct smbcli_request *smb_raw_nttrans_send(struct smbcli_tree *tree,
        outparam = req->out.data + align;
        outdata = outparam + parms->in.params.length;
 
+       if (align != 0) {
+               memset(req->out.data, 0, align);
+       }
+
        SCVAL(req->out.vwv,  0, parms->in.max_setup);
        SSVAL(req->out.vwv,  1, 0); /* reserved */
        SIVAL(req->out.vwv,  3, parms->in.params.length);