Re: BSD Flags further
Re: BSD Flags further
- Subject: Re: BSD Flags further
- From: Jeffrey Ellis <email@hidden>
- Date: Wed, 18 Oct 2006 22:26:01 -0700
- Thread-topic: BSD Flags further
Hi, Terry--
Thank you very much. This was exactly what I needed... :)
All My Best,
Jeffrey
on 10/18/06 3:19 PM, Terry Lambert at email@hidden wrote:
> On Oct 18, 2006, at 9:22 AM, Jeffrey Ellis wrote:
>
>> on 10/18/06 4:01 AM, Michael Smith at email@hidden wrote:
>>> On Oct 18, 2006, at 12:26 AM, Jeffrey Ellis wrote:
>>>> Can someone explain what the actual effect of setting each flag is,
>>>> namely:
>>>>
>>>> arch
>>>> opaque
>>>> nodump
>>>
>>> These three have no significant meaning.
>>
>> I actually read a discussion somewhere, where the user was saying that
>> setting the opaque flag was supposed to help in some instances
>> (sorry, I
>> didn't quite follow what they were trying to do, and I can't find that
>> thread anymore...)
>>
>> The only definition I've found so far is:
>>
>> The opaque flag will prevent a full union stack
>> traversal on later lookups.
>>
>> I have absolutely no idea what this means.
>
> Actually:
>
> more /usr/include/sys/stat.h
> ...
> /*
> * Definitions of flags stored in file flags word.
> *
> * Super-user and owner changeable flags.
> */
> #define UF_SETTABLE 0x0000ffff /* mask of owner changeable
> flags */
> #define UF_NODUMP 0x00000001 /* do not dump file */
> #define UF_IMMUTABLE 0x00000002 /* file may not be changed */
> #define UF_APPEND 0x00000004 /* writes to file may only
> append */
> #define UF_OPAQUE 0x00000008 /* directory is opaque wrt.
> union */
> /*
> * The following bit is reserved for FreeBSD. It is not implemented
> * in Mac OS X.
> */
> /* #define UF_NOUNLINK 0x00000010 */ /* file may not be removed or
> renamed */
> /* Bits 0x0020 through 0x4000 are currently undefined. */
> #define UF_HIDDEN 0x00008000 /* hint that this item should
> not be */
> /* displayed in a GUI */
> /*
> * Super-user changeable flags.
> */
> #define SF_SETTABLE 0xffff0000 /* mask of superuser
> changeable flags */
> #define SF_ARCHIVED 0x00010000 /* file is archived */
> #define SF_IMMUTABLE 0x00020000 /* file may not be changed */
> #define SF_APPEND 0x00040000 /* writes to file may only
> append */
> /*
> * The following two bits are reserved for FreeBSD. They are not
> * implemented in Mac OS X.
> */
> /* #define SF_NOUNLINK 0x00100000 */ /* file may not be removed or
> renamed */
> /* #define SF_SNAPSHOT 0x00200000 */ /* snapshot inode */
> /* NOTE: There is no SF_HIDDEN bit. */
> ---
>
> If it's not clear from the comments:
>
> UF_NODUMP The "dump" command (man dump) will ignore the file
> UF_OPAQUE If a directory has this flag, and the file system is mounted
> over top of another FS which has the same directory, then only this
> directory will show, rather than the underlying FS directory being
> visible.
>
> NODUMP is generally useful only if your backup utility knows about it.
>
> OPAQUE is generally useful for things like mounting an object file
> directory over top of a CDROM so you can e.g. do builds of source code
> off a CDROM without neding to copy it all to a writeable disk.
>
> SF_ flags are "system" flags, as opposed to UF) flags, which are user
> flags.
>
> As Mike noted, you can't reset SF_ flags if the kern.securelevel
> sysctl is 1 or higher. Mac OS X runs at secure level 1 in mutiluser,
> and secure level 0 in single user. For more information on secure
> levels, which are generally not a user feature for Mac OS X, you can
> look at the FreeBSD "init" documentation, available at:
>
> <http://www.freebsd.org/cgi/man.cgi?query=init&apropos=0&sektion=0&manpath=Fre
> eBSD+6.1-RELEASE&format=html
>>
>
> Bottom line is that you will not be unable to reset these except in
> single user mode, for security reasons, so be selective in where and
> when you set them.
>
> -- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden