RFC: "hide dot files" overwritten by "store dos attributes"

Jeremy Allison jra at samba.org
Tue Dec 15 18:57:09 UTC 2015


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.




> -- 
> 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 74538f1c690c2c341878e85b80cfb9864b4f126e 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] WIP 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 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".
> 
> What is wrong, the code or the documentation?
> ---
>  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