]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: VFS: Add custom initialization for vfs_widelinks.
authorJeremy Allison <jra@samba.org>
Tue, 7 Apr 2020 00:24:10 +0000 (17:24 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 9 Apr 2020 19:40:35 +0000 (19:40 +0000)
As the widelinks logic is now moving into a
vfs_widelinks module, we need to custom load
it after the default module is initialized.
That way no changes to smb.conf files are
needed.

We may revisit this for Samba 5.0 and force
people to change their smb.conf files and
explicitly load this as a vfs module if they
want the insecure widelinks behavior.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/vfs.c

index f99c12f045163c145f29bee98c7164ac2336d2b6..185383782e83878b799c60dbfc5b8bdba209145f 100644 (file)
@@ -365,6 +365,22 @@ bool smbd_vfs_init(connection_struct *conn)
                return True;
        }
 
+       if (lp_widelinks(SNUM(conn))) {
+               /*
+                * As the widelinks logic is now moving into a
+                * vfs_widelinks module, we need to custom load
+                * it after the default module is initialized.
+                * That way no changes to smb.conf files are
+                * needed.
+                */
+               bool ok = vfs_init_custom(conn, "widelinks");
+               if (!ok) {
+                       DBG_ERR("widelinks enabled and vfs_init_custom "
+                               "failed for vfs_widelinks module\n");
+                       return false;
+               }
+       }
+
        vfs_objects = lp_vfs_objects(SNUM(conn));
 
        /* Override VFS functions if 'vfs object' was not specified*/