From: Jeremy Allison Date: Sat, 19 Mar 2016 04:50:15 +0000 (-0700) Subject: s3: posix_acls. Always use STAT, not LSTAT here. X-Git-Tag: tdb-1.3.9~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f245c5ff4f175873f94b108b506527ee06d2a28;p=thirdparty%2Fsamba.git s3: posix_acls. Always use STAT, not LSTAT here. We have already refused acls on a symlink. Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni --- diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 8fc7cbae3fa..2bb90c4be14 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -3566,11 +3566,13 @@ NTSTATUS posix_get_nt_acl(struct connection_struct *conn, } /* Get the stat struct for the owner info. */ - if (lp_posix_pathnames()) { - ret = SMB_VFS_LSTAT(conn, smb_fname); - } else { - ret = SMB_VFS_STAT(conn, smb_fname); - } + /* + * We can directly use SMB_VFS_STAT here, as if this was a + * POSIX call on a symlink, we've already refused it. + * For a Windows acl mapped call on a symlink, we want to follow + * it. + */ + ret = SMB_VFS_STAT(conn, smb_fname); if (ret == -1) { TALLOC_FREE(frame);