From: Jeremy Allison Date: Tue, 13 Jul 2021 00:35:26 +0000 (-0700) Subject: s3: smbd: Add dirfsp, atname parameters to check_msdfs_link(). X-Git-Tag: talloc-2.3.3~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b71ead1cc096eaf28edfd2c30f374a89c30f7b7;p=thirdparty%2Fsamba.git s3: smbd: Add dirfsp, atname parameters to check_msdfs_link(). Replace the old connection_struct *conn parameter. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 27f6b4aa352..5b77acaae2a 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1549,13 +1549,14 @@ NTSTATUS unix_perms_from_wire(connection_struct *conn, to be a directory if it's a msdfs link. ****************************************************************************/ -static bool check_msdfs_link(connection_struct *conn, - struct smb_filename *smb_fname) +static bool check_msdfs_link(struct files_struct *dirfsp, + struct smb_filename *atname, + struct smb_filename *smb_fname) { int saved_errno = errno; if(lp_host_msdfs() && - lp_msdfs_root(SNUM(conn)) && - is_msdfs_link(conn, smb_fname)) { + lp_msdfs_root(SNUM(dirfsp->conn)) && + is_msdfs_link(dirfsp->conn, smb_fname)) { DEBUG(5,("check_msdfs_link: Masquerading msdfs link %s " "as a directory\n", @@ -1704,7 +1705,8 @@ static bool smbd_dirptr_lanman2_mode_fn(TALLOC_CTX *ctx, /* Needed to show the msdfs symlinks as * directories */ - ms_dfs_link = check_msdfs_link(state->conn, + ms_dfs_link = check_msdfs_link(dirfsp, + atname, smb_fname); if (!ms_dfs_link) { DEBUG(5,("smbd_dirptr_lanman2_mode_fn: "