diff options
author | Ralph Boehme <slow@samba.org> | 2019-04-16 19:25:09 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-08-08 20:24:33 +0000 |
commit | fef3a4c75f9cad1a81201257f0208b241a93f6c9 (patch) | |
tree | 8ebb60dc6edc6a26169aba37fc17409aefc75f71 /source3/rpc_server | |
parent | c4b2dc95d5dfb4e875ea58ff6568b89dacf8b916 (diff) | |
download | samba-fef3a4c75f9cad1a81201257f0208b241a93f6c9.tar.gz |
s3:mdssvc: initialize the returned share_path with the empty string
macOS returns the empty path for an unknown share. This paves the way for that
change. Currently we still fail the RPC request if the share is not known with
DCERPC_FAULT_CANT_PERFORM, but this is wrong and is going to be changed in the
next commit.
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/mdssvc/srv_mdssvc_nt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c index 289167e0975..49a26fac678 100644 --- a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c +++ b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c @@ -145,6 +145,7 @@ static NTSTATUS create_mdssvc_policy_handle(TALLOC_CTX *mem_ctx, void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r) { int snum; + char *outpath = discard_const_p(char, r->out.share_path); char *path; NTSTATUS status; @@ -153,6 +154,7 @@ void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r) *r->out.device_id = *r->in.device_id; *r->out.unkn2 = *r->in.unkn2; *r->out.unkn3 = *r->out.unkn3; + outpath[0] = '\0'; snum = lp_servicenumber(r->in.share_name); if (!VALID_SNUM(snum)) { @@ -184,7 +186,7 @@ void _mdssvc_open(struct pipes_struct *p, struct mdssvc_open *r) return; } - strlcpy(discard_const_p(char, r->out.share_path), path, 1024); + strlcpy(outpath, path, 1024); talloc_free(path); } |