From nobody@FreeBSD.org  Wed Mar 15 22:09:43 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 47FFC16A424
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Mar 2006 22:09:43 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 268B743D9B
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Mar 2006 22:09:35 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k2FM9ZUG006919
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 15 Mar 2006 22:09:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k2FM9Z10006918;
	Wed, 15 Mar 2006 22:09:35 GMT
	(envelope-from nobody)
Message-Id: <200603152209.k2FM9Z10006918@www.freebsd.org>
Date: Wed, 15 Mar 2006 22:09:35 GMT
From: Mark Day <mday@apple.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] Add UF_HIDDEN file flag; map it to Windows "hidden" attribute for msdosfs, ntfs
X-Send-Pr-Version: www-2.3

>Number:         94519
>Category:       kern
>Synopsis:       [libc] [patch] Add UF_HIDDEN file flag; map it to Windows "hidden" attribute for msdosfs, ntfs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 16 15:08:34 GMT 2006
>Closed-Date:    Sun Apr 13 20:13:58 UTC 2014
>Last-Modified:  Sun Apr 13 20:13:58 UTC 2014
>Originator:     Mark Day
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
Apple Computer, Inc.
>Environment:
System: FreeBSD daybreak.apple.com 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Tue Mar 14 18:11:52 PST 2006 root@daybreak.apple.com:/usr/obj/usr/src-hidden/sys/DAYBREAK i386

cvsup was done approximately Tue Mar 14 15:00 PST 2006
>Description:
This adds a file flag which can be used as a hint to applications
(especially GUIs) that a particular file or directory should not be
displayed to the user by default.  For Windows file systems, this would
be mapped to their native "hidden" attribute.  For Macintosh file
systems, this would be mapped to the "invisible" bit of the Finder Info.

The patch includes a libc change to strtofflags(3) and fflagstostr(3)
mapping the bit to the name "hidden" so it can be accessed via ls(1)
and chflags(1).

The patch also maps the Windows "read-only" attribute bit to the
UF_IMMUTABLE file flag (for both msdosfs and ntfs).

This change originated in Mac OS X (in a version not yet released).
The patch is offered to help keep the file flags in FreeBSD and
Mac OS X in sync.

>How-To-Repeat:
In the Windows GUI, select a file on a FAT or NTFS volume.
Right-click on the file and select "Properties" from the menu.
Check the box titled "Hidden".
Take that disk to a FreeBSD machine and do "ls -lo" on it.
With this patch, "hidden" will be displayed in the flags column.

>Fix:
uuencoded patch:

begin 644 hidden.diff
M9&EF9B`M3F%U<B!S<F,O8FEN+V-H9FQA9W,O8VAF;&%G<RXQ('-R8RUH:61D
M96XO8FEN+V-H9FQA9W,O8VAF;&%G<RXQ"BTM+2!S<F,O8FEN+V-H9FQA9W,O
M8VAF;&%G<RXQ"49R:2!-87(@,3`@,3(Z,S<Z,3D@,C`P-@HK*RL@<W)C+6AI
M9&1E;B]B:6XO8VAF;&%G<R]C:&9L86=S+C$)5V5D($UA<B`Q-2`P,#HU,#HT
M-R`R,#`V"D!`("TQ,#0L-B`K,3`T+#@@0$`*('-E="!T:&4@=7-E<B!I;6UU
M=&%B;&4@9FQA9R`H;W=N97(@;W(@<W5P97(M=7-E<B!O;FQY*0H@+DET($-M
M('5U;FQN:R`L('5U;FQI;FL*('-E="!T:&4@=7-E<B!U;F1E;&5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M<"T^=F%?9FQA9W,@/2`P.PH@"6EF("@H9&5P+3YD95]!='1R:6)U=&5S("8@
M05144E]!4D-(259%*2`]/2`P*0H@"0EV87`M/G9A7V9L86=S('P](%-&7T%2
M0TA)5D5$.PHK"6EF("AD97`M/F1E7T%T=')I8G5T97,@)B!!5%127U)%041/
M3DQ9*0HK"0EV87`M/G9A7V9L86=S('P](%5&7TE-355404),13L**PEI9B`H
M9&5P+3YD95]!='1R:6)U=&5S("8@05144E](241$14XI"BL)"79A<"T^=F%?
M9FQA9W,@?#T@549?2$E$1$5..PH@"79A<"T^=F%?9V5N(#T@,#L*(`EV87`M
M/G9A7V)L;V-K<VEZ92`]('!M<"T^<&U?8G!C;'5S=&5R.PH@"79A<"T^=F%?
M8GET97,@/0I`0"`M-#(Q+#$R("LT,C4L,C`@0$`*(`D)"6EF("AV87`M/G9A
M7V9L86=S("8@4T9?4T545$%"3$4I"B`)"0D)<F5T=7)N($5015)-.PH@"0E]
M"BT)"6EF("AV87`M/G9A7V9L86=S("8@?E-&7T%20TA)5D5$*0HK"0EI9B`H
M=F%P+3YV85]F;&%G<R`F('XH4T9?05)#2$E6141\549?24U-551!0DQ%?%5&
M7TA)1$1%3BDI"B`)"0ER971U<FX@14]03D]44U504#L*(`D):68@*'9A<"T^
M=F%?9FQA9W,@)B!31E]!4D-(259%1"D*(`D)"61E<"T^9&5?071T<FEB=71E
M<R`F/2!^05144E]!4D-(259%.PH@"0EE;'-E(&EF("@A*&1E<"T^9&5?071T
M<FEB=71E<R`F($%45%)?1$E214-43U)9*2D*(`D)"61E<"T^9&5?071T<FEB
M=71E<R!\/2!!5%127T%20TA)5D4["BL)"6EF("AV87`M/G9A7V9L86=S("8@
M549?24U-551!0DQ%*0HK"0D)9&5P+3YD95]!='1R:6)U=&5S('P]($%45%)?
M4D5!1$].3%D["BL)"65L<V4**PD)"61E<"T^9&5?071T<FEB=71E<R`F/2!^
M05144E]214%$3TY,63L**PD):68@*'9A<"T^=F%?9FQA9W,@)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=F%P+3YV85]T
M>7!E(#T@=G`M/G9?='EP93L*9&EF9B`M3F%U<B!S<F,O<WES+W-Y<R]S=&%T
M+F@@<W)C+6AI9&1E;B]S>7,O<WES+W-T870N:`HM+2T@<W)C+W-Y<R]S>7,O
M<W1A="YH"51U92!-87(@,C(@,#$Z,3DZ,3@@,C`P-0HK*RL@<W)C+6AI9&1E
M;B]S>7,O<WES+W-T870N:`E7960@36%R(#$U(#`P.C4P.C0W(#(P,#8*0$`@
M+3(X,BPV("LR.#(L."!`0`H@(V1E9FEN90E51E]!4%!%3D0),'@P,#`P,#`P
M-`DO*B!W<FET97,@=&\@9FEL92!M87D@;VYL>2!A<'!E;F0@*B\*("-D969I
M;F4@549?3U!!455%"3!X,#`P,#`P,#@)+RH@9&ER96-T;W)Y(&ES(&]P87%U
M92!W<G0N('5N:6]N("HO"B`C9&5F:6YE(%5&7TY/54Y,24Y+"3!X,#`P,#`P
M,3`)+RH@9FEL92!M87D@;F]T(&)E(')E;6]V960@;W(@<F5N86UE9"`J+PHK
M(V1E9FEN92!51E](241$14X),'@P,#`P.#`P,`DO*B!H:6YT('1H870@=&AI
M<R!I=&5M('-H;W5L9"!N;W0@8F4@*B\**PD)"0D)+RH@9&ES<&QA>65D(&EN
M(&$@1U5)("HO"B`O*@H@("H@4W5P97(M=7-E<B!C:&%N9V5A8FQE(&9L86=S
'+@H@("HO"@``
`
end

>Release-Note:
>Audit-Trail:

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org,
 mday@apple.com
Cc: Ken Merry <ken@freebsd.org>
Subject: Re: kern/94519: [libc] [patch] Add UF_HIDDEN file flag; map it to Windows &quot;hidden&quot; attribute for msdosfs, ntfs
Date: Fri, 3 May 2013 11:49:57 -0400

 Another file-flag related patch.
 
 -- 
 John Baldwin
State-Changed-From-To: open->closed 
State-Changed-By: jilles 
State-Changed-When: Sun Apr 13 20:12:38 UTC 2014 
State-Changed-Why:  
The UF_HIDDEN flag was added in SVN r254627 (present in 10.0-RELEASE). 

As noted in that commit, FreeBSD has different handling for the 
readonly attribute than submitted in this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94519 
>Unformatted:
