RFC: "hide dot files" overwritten by "store dos attributes"
Jeremy Allison
jra at samba.org
Wed Dec 16 00:09:54 UTC 2015
On Tue, Dec 15, 2015 at 10:19:56PM +0100, Ralph Boehme wrote:
> On Tue, Dec 15, 2015 at 10:57:09AM -0800, Jeremy Allison wrote:
> > On Tue, Dec 15, 2015 at 01:21:49PM +0100, Ralph Boehme wrote:
> > > Hi!
> > >
> > > Please see attached patch. Is this a works as degined or a bug?
> >
> > Oh - that's a really good catch. I think it's a bug.
> > We set "hide dot files = true" by default so I think
> > we want "hide dot files" to be able to override
> > store dos attributes here.
>
> thanks for confirming! Updated patch with bug id attached.
Yep, that was definitely the intent. Note the comment
in the get_ea_dos_attribute() function:
/* Don't reset pattr to zero as we may already have filename-based attributes we
need to preserve. */
Pushed - thanks !
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de,mailto:kontakt@sernet.de
> From f6ea47e6fa4a2fd479c38e5cde423aa6dd8b87d9 Mon Sep 17 00:00:00 2001
> From: Ralph Boehme <slow at samba.org>
> Date: Tue, 15 Dec 2015 13:13:02 +0100
> Subject: [PATCH] smbd: make "hide dot files" option work with "store dos
> attributes = yes"
>
> When using "store dos attributes = yes", the function that reads the
> attributes from the xattr get_ea_dos_attribute() will overwrite the
> attribute previously set for "hide dot files".
>
> According to smb.conf, "store dos attributes = yes" should only
> overwrite the "map XXX" options, but not "hide dot files".
>
> Bug: https://bugzilla.samba.org/show_bug.cgi?id=11645
>
> Signed-off-by: Ralph Boehme <slow at samba.org>
> ---
> source3/smbd/dosmode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
> index 0f3eef0..0996007 100644
> --- a/source3/smbd/dosmode.c
> +++ b/source3/smbd/dosmode.c
> @@ -365,7 +365,7 @@ static bool get_ea_dos_attribute(connection_struct *conn,
> dosattr |= FILE_ATTRIBUTE_DIRECTORY;
> }
> /* FILE_ATTRIBUTE_SPARSE is valid on get but not on set. */
> - *pattr = (uint32_t)(dosattr & (SAMBA_ATTRIBUTES_MASK|FILE_ATTRIBUTE_SPARSE));
> + *pattr |= (uint32_t)(dosattr & (SAMBA_ATTRIBUTES_MASK|FILE_ATTRIBUTE_SPARSE));
>
> dos_mode_debug_print(__func__, *pattr);
>
> --
> 2.5.0
>
More information about the samba-technical
mailing list