From: Jeremy Allison Date: Thu, 6 Feb 2020 23:55:13 +0000 (-0800) Subject: s3: DFS: Don't allow link creation on a read-only share. X-Git-Tag: ldb-2.1.1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4195cd488e1366887acfea6ae03bf4198514a15;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme --- 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,