From 886d2c09b84787062c98e26dfccceaba6420cf6c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 6 Apr 2020 17:24:10 -0700 Subject: [PATCH] s3: smbd: VFS: Add custom initialization for vfs_widelinks. 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 Reviewed-by: Ralph Boehme --- source3/smbd/vfs.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index f99c12f0451..185383782e8 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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*/ -- 2.47.3