From owner-freebsd-fs@FreeBSD.ORG Wed Mar 1 18:18:15 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EC9316A423 for ; Wed, 1 Mar 2006 18:18:15 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7805143D58 for ; Wed, 1 Mar 2006 18:18:14 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 15B3C46C0F; Wed, 1 Mar 2006 13:17:54 -0500 (EST) Date: Wed, 1 Mar 2006 18:22:39 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Mark Day In-Reply-To: Message-ID: <20060301182001.W40707@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-fs@freebsd.org Subject: Re: Add a file flag for "hidden" files? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2006 18:18:15 -0000 On Wed, 1 Mar 2006, Mark Day wrote: > I could certainly provide patches to FreeBSD for the headers, FAT, NTFS, and > probably HFS. The strtofflags(3) and fflagstostr(3) functions should also > change so you can get at the flag bit via ls(1), find(1), chflags(1), etc.; > I think I could provide that patch, too. (I've never actually used FreeBSD, > so it will take me a bit of time to get it installed, find my way around the > sources, make and test the changes.) I don't see any problem with this. The only flag I know of in FreeBSD that might not appear in Mac OS X is the system snapshot flag, which was added to UFS after Apple forked from the FreeBSD source. You can find current flag allocation here: http://fxr.watson.org/fxr/source/sys/stat.h 274 /* 275 * Definitions of flags stored in file flags word. 276 * 277 * Super-user and owner changeable flags. 278 */ 279 #define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */ 280 #define UF_NODUMP 0x00000001 /* do not dump file */ 281 #define UF_IMMUTABLE 0x00000002 /* file may not be changed */ 282 #define UF_APPEND 0x00000004 /* writes to file may only append */ 283 #define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */ 284 #define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */ 285 /* 286 * Super-user changeable flags. 287 */ 288 #define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */ 289 #define SF_ARCHIVED 0x00010000 /* file is archived */ 290 #define SF_IMMUTABLE 0x00020000 /* file may not be changed */ 291 #define SF_APPEND 0x00040000 /* writes to file may only append */ 292 #define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */ 293 #define SF_SNAPSHOT 0x00200000 /* snapshot inode */ We have talked about adding a flag to hint the presence of extended ACL data also, so that applications know if they should rely solely on stat() for protection information, or also call acl_get_{fd,file,link}() to receive extended ACL data for ls(1) output. Is your plan to mask hidden files solely in user space, or to look at masking it in kernel also? Robert N M Watson