Is chflags' "nodump + sunlnk" = "uchg"

Dan Nelson dnelson at allantgroup.com
Wed Nov 12 15:43:49 PST 2008


In the last episode (Nov 12), Charles Darwin said:
> Hi all,
> 
> Title is the question actually:  Is chflags' "nodump + sunlnk" = "uchg"

No; why would it be?  From /usr/include/sys/stat.h:

#define UF_NODUMP       0x00000001 /* do not dump file */
#define SF_NOUNLINK     0x00100000 /* file may not be removed or renamed */

#define UF_IMMUTABLE    0x00000002 /* file may not be changed */

nodump+sunlnk would be 0x00100001, while uchg is 0x00000002 .

# touch a b
# chflags nodump,sunlnk a
# chflags uchg b
# ls -lo a b
-rw-r--r--  1 root  wheel  sunlnk,nodump 0 Nov 12 17:42 a
-rw-r--r--  1 root  wheel  uchg          0 Nov 12 17:42 b
# 



-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list