]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: DFS: Don't allow link deletion on a read-only share.
authorJeremy Allison <jra@samba.org>
Fri, 7 Feb 2020 00:20:59 +0000 (16:20 -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 fd58a255869b79dac9734e080e805f1a9a8816ab..8f355d3a2c98773607386c1f1b6534213173b926 100644 (file)
@@ -1504,6 +1504,17 @@ bool remove_msdfs_link(const struct junction_map *jucn,
                return false;
        }
 
+       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 remove DFS entry on read-only share %s\n",
+                       lp_servicename(frame, lp_sub, snum));
+               TALLOC_FREE(frame);
+               return false;
+       }
+
        smb_fname = synthetic_smb_fname(frame,
                                        path,
                                        NULL,