Ensure when calculating the access mask for MAXIMUM_ALLOWED_ACCESS that we add in...
authorJeremy Allison <jra@samba.org>
Tue, 13 Nov 2012 00:22:52 +0000 (16:22 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 3 Dec 2012 19:22:41 +0000 (20:22 +0100)
If we can access the path to this file, by
default we have FILE_READ_ATTRIBUTES from the
containing directory. See the section.
"Algorithm to Check Access to an Existing File"
in MS-FSA.pdf.

source3/smbd/open.c

index f97a3ec5e581550a48b71bccb3c06f2212becd70..d10b6978be6058be9474c88d90d4a4314e160825 100644 (file)
@@ -1423,7 +1423,14 @@ NTSTATUS smbd_calculate_access_mask(connection_struct *conn,
                                }
                        }
 
-                       access_mask = access_granted;
+                       /*
+                        * If we can access the path to this file, by
+                        * default we have FILE_READ_ATTRIBUTES from the
+                        * containing directory. See the section.
+                        * "Algorithm to Check Access to an Existing File"
+                        * in MS-FSA.pdf.
+                        */
+                       access_mask = access_granted | FILE_READ_ATTRIBUTES;
                } else {
                        access_mask = FILE_GENERIC_ALL;
                }