]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Add clarifying comment on mode change on overwritten files.
authorJeremy Allison <jra@samba.org>
Thu, 17 May 2018 17:24:35 +0000 (10:24 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 25 May 2018 16:39:24 +0000 (18:39 +0200)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/open.c

index 9d581a533590570c6aab4560b56f411548944514..1b83e8403d2c8e3a4c2eb2fe33a6c1a9c7d2fb31 100644 (file)
@@ -3786,6 +3786,25 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                }
 
        } else if (new_unx_mode) {
+               /*
+                * We only get here in the case of:
+                *
+                * a). Not a POSIX open.
+                * b). File already existed.
+                * c). File was overwritten.
+                * d). Requested DOS attributes didn't match
+                *     the DOS attributes on the existing file.
+                *
+                * In that case new_unx_mode has been set
+                * equal to the calculated mode (including
+                * possible inheritance of the mode from the
+                * containing directory).
+                *
+                * Note this mode was calculated with the
+                * DOS attribute FILE_ATTRIBUTE_ARCHIVE added,
+                * so the mode change here is suitable for
+                * an overwritten file.
+                */
 
                int ret = -1;