mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s3: srvsvc pipe - We should return WERR_BADFILE in _srvsvc_NetShareAdd if the path does not exist.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Reviewed-by: David Disseldorp <ddiss@suse.de> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Apr 22 22:19:18 CEST 2014 on sn-devel-104
This commit is contained in:
parent
c0651a32fc
commit
6549716cc1
@ -1946,6 +1946,7 @@ WERROR _srvsvc_NetShareAdd(struct pipes_struct *p,
|
||||
struct security_descriptor *psd = NULL;
|
||||
bool is_disk_op;
|
||||
int max_connections = 0;
|
||||
SMB_STRUCT_STAT st;
|
||||
TALLOC_CTX *ctx = p->mem_ctx;
|
||||
|
||||
DEBUG(5,("_srvsvc_NetShareAdd: %d\n", __LINE__));
|
||||
@ -2045,6 +2046,16 @@ WERROR _srvsvc_NetShareAdd(struct pipes_struct *p,
|
||||
return WERR_OBJECT_PATH_INVALID;
|
||||
}
|
||||
|
||||
ret = sys_lstat(path, &st, false);
|
||||
if (ret == -1 && (errno != EACCES)) {
|
||||
/*
|
||||
* If path has any other than permission
|
||||
* problem, return WERR_BADFILE (as Windows
|
||||
* does.
|
||||
*/
|
||||
return WERR_BADFILE;
|
||||
}
|
||||
|
||||
/* Ensure share name, pathname and comment don't contain '"' characters. */
|
||||
string_replace(share_name_in, '"', ' ');
|
||||
string_replace(share_name, '"', ' ');
|
||||
|
Loading…
Reference in New Issue
Block a user