[PATCH] s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new file.
Jeremy Allison
jra at samba.org
Fri Feb 5 00:27:32 UTC 2016
On Thu, Feb 04, 2016 at 07:01:00AM -0600, José A. Rivera wrote:
> Hey folks,
>
> The initial patch was failing some autobuild tests. Turns out we should
> probably not skip file_set_dosmode if we still need to set the
> user.DOSATTRIB
> EA. :) However, we only need to worry about fixing the archive bit
> if the
> file has been overwritten.
Makes sense. Pushed - thanks !
> From c9fa58f9dc484b94247647c54252c9ae6c977b6c Mon Sep 17 00:00:00 2001
> From: "Jose A. Rivera" <jarrpa at samba.org>
> Date: Wed, 3 Feb 2016 20:58:19 -0600
> Subject: [PATCH] s3:smbd:open: Skip redundant call to file_set_dosmode when
> creating a new file.
>
> Signed-off-by: Jose A. Rivera <jarrpa at samba.org>
> Pair-programmed-with: Ira Cooper <ira at samba.org>
> ---
> source3/smbd/open.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/source3/smbd/open.c b/source3/smbd/open.c
> index ed0594b..fa817e4 100644
> --- a/source3/smbd/open.c
> +++ b/source3/smbd/open.c
> @@ -3169,8 +3169,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
> }
>
> if (info != FILE_WAS_OPENED) {
> - /* Files should be initially set as archive */
> - if (lp_map_archive(SNUM(conn)) ||
> + /* Overwritten files should be initially set as archive */
> + if ((info == FILE_WAS_OVERWRITTEN && lp_map_archive(SNUM(conn))) ||
> lp_store_dos_attributes(SNUM(conn))) {
> if (!posix_open) {
> if (file_set_dosmode(conn, smb_fname,
> --
> 2.5.0
>
More information about the samba-technical
mailing list