From: Jeremy Allison Date: Tue, 7 Apr 2020 00:31:16 +0000 (-0700) Subject: s3: VFS: Remove the lp_widelinks() check from check_reduced_name(). X-Git-Tag: ldb-2.2.0~932 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47b7f3319e4ad9bc25eea151d3209d387c1decc6;p=thirdparty%2Fsamba.git s3: VFS: Remove the lp_widelinks() check from check_reduced_name(). Widelinks are now always denied, unless the vfs_widelinks VFS module is loaded. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 185383782e8..f31110e5993 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1221,7 +1221,6 @@ NTSTATUS check_reduced_name(connection_struct *conn, char *resolved_name = NULL; char *new_fname = NULL; bool allow_symlinks = true; - bool allow_widelinks = false; DBG_DEBUG("check_reduced_name [%s] [%s]\n", fname, conn->connectpath); @@ -1296,11 +1295,8 @@ NTSTATUS check_reduced_name(connection_struct *conn, return NT_STATUS_OBJECT_NAME_INVALID; } - allow_widelinks = lp_widelinks(SNUM(conn)); - allow_symlinks = lp_follow_symlinks(SNUM(conn)); - /* Common widelinks and symlinks checks. */ - if (!allow_widelinks || !allow_symlinks) { + { const char *conn_rootdir; size_t rootdir_len; @@ -1343,6 +1339,7 @@ NTSTATUS check_reduced_name(connection_struct *conn, } /* Extra checks if all symlinks are disallowed. */ + allow_symlinks = lp_follow_symlinks(SNUM(conn)); if (!allow_symlinks) { /* fname can't have changed in resolved_path. */ const char *p = &resolved_name[rootdir_len];