From: Ralph Boehme Date: Thu, 19 Mar 2020 10:19:48 +0000 (+0100) Subject: smbd: use canonicalize_connect_path() in create_conn_struct_as_root() X-Git-Tag: ldb-2.2.0~1248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11f14c2ca116115d895b150b2901c1d909bb75de;p=thirdparty%2Fsamba.git smbd: use canonicalize_connect_path() in create_conn_struct_as_root() This fix ensures create_conn_struct_as_root() works the same way as make_connection_snum() used in smbd for SMB sessions. Without this any caller of create_conn_struct_as_root() will fail to use work on shares if the sharepath contains a symlink. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index ae2a89c3faa..9bac6f6f81f 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -357,6 +357,14 @@ static NTSTATUS create_conn_struct_as_root(TALLOC_CTX *ctx, return NT_STATUS_UNSUCCESSFUL; } + if (!lp_widelinks(snum)) { + if (!canonicalize_connect_path(conn)) { + DBG_ERR("Failed to canonicalize sharepath\n"); + conn_free(conn); + return NT_STATUS_ACCESS_DENIED; + } + } + talloc_free(conn->origpath); conn->origpath = talloc_strdup(conn, conn->connectpath); if (conn->origpath == NULL) {