http://git.samba.org/?p=tprouty/samba.git; a=shortlog; h=dos_attr_work

James Peach jorgar at gmail.com
Tue Nov 11 01:18:42 GMT 2008


2008/11/10 Tim Prouty <tprouty at samba.org>:
> Hi,
>
> The patch referenced in $SUBJECT adds support for storing dos attributes as
> st_flags in the stat struct on systems that support it.
>
> Some filesystems can store dos attributes directly in the inode's st_flags
> and access them through the stat struct.
>
> This patch:
>    - Adds a configure check to see if the special flags are available.
>    - Implements getting and setting dos attributes in the stat struct and
> inode, respectively.
>
> This will not change the existing functionality of any system that doesn't
> have the special flags available.
>
> Comment/suggestions?

1. You should #ifdef some of the UF_* constants, because lots of
systems don't have more than the minimal set or use different names.
The names you have don't seem to be the standard BSD names.

2. When you are getting the flags, you should also check the SF_*
equivalents, eg, SF_IMMUTABLE.

3. The DOS archive bit is actually the inverse of the BSD archive bit.
Although the standard BSD mit is UF_NODUMP, so maybe UF_DOS_ARCHIVE is
different?

4. My patch also checks UF_IMMUTABLE in can_access_file() ... not sure
whether you would still need that.

5. You don't need the configure check at all. SMB_VFS_CHFLAGS takes
care of portably setting the flags and there is already a check for
the st_flags field. Just wrap the usages of UD_DOS_* in #ifdefs.

6. The change to proto.h seems spurious?
-- 
James Peach | jorgar at gmail.com


More information about the samba-technical mailing list