diff options
author | Jeremy Allison <jra@samba.org> | 2020-02-06 15:55:13 -0800 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2020-02-18 21:08:32 +0000 |
commit | b4195cd488e1366887acfea6ae03bf4198514a15 (patch) | |
tree | b6612258f60aa1421c77a6101a0ab5b8e2d63b2e | |
parent | e2ea059e671140b32ea2ab1a35691a8e35d4a5f4 (diff) | |
download | samba-b4195cd488e1366887acfea6ae03bf4198514a15.tar.gz |
s3: DFS: Don't allow link creation on a read-only share.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14269
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | source3/smbd/msdfs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 75ad2d9223b..fd58a255869 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1432,6 +1432,16 @@ bool create_msdfs_link(const struct junction_map *jucn, goto out; } + if (!CAN_WRITE(conn)) { + const struct loadparm_substitution *lp_sub = + loadparm_s3_global_substitution(); + int snum = lp_servicenumber(jucn->service_name); + + DBG_WARNING("Can't create DFS entry on read-only share %s\n", + lp_servicename(frame, lp_sub, snum)); + goto out; + } + smb_fname = synthetic_smb_fname(frame, path, NULL, |