]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: DFS: Don't allow link creation on a read-only share.
authorJeremy Allison <jra@samba.org>
Thu, 6 Feb 2020 23:55:13 +0000 (15:55 -0800)
committerRalph Boehme <slow@samba.org>
Tue, 18 Feb 2020 21:08:32 +0000 (21:08 +0000)
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>
source3/smbd/msdfs.c

index 75ad2d9223b40b33f61fa07614e0c2d8910386c4..fd58a255869b79dac9734e080e805f1a9a8816ab 100644 (file)
@@ -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,