smbd: ignore symlinks in file_set_dosmode()
authorRalph Boehme <slow@samba.org>
Tue, 31 Oct 2023 09:06:38 +0000 (10:06 +0100)
committerJeremy Allison <jra@samba.org>
Sun, 5 Nov 2023 18:34:38 +0000 (18:34 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dosmode.c

index 2eef953a9cb8a9a4c97e1985274e627e2a51b756..8b51f5a7d8b15f15e426f27698fb61f9d8aba766 100644 (file)
@@ -903,6 +903,11 @@ int file_set_dosmode(connection_struct *conn,
                return -1;
        }
 
+       if (S_ISLNK(smb_fname->st.st_ex_mode)) {
+               /* A symlink in POSIX context, ignore */
+               return 0;
+       }
+
        if ((S_ISDIR(smb_fname->st.st_ex_mode)) &&
            (dosmode & FILE_ATTRIBUTE_TEMPORARY))
        {