Date: Mon, 20 Nov 2017 14:08:12 -0600 From: Karl Denninger <karl@denninger.net> To: freebsd-fs@freebsd.org Subject: Re: MSDOS Filesystem question related to "read-only" files Message-ID: <0e31a0cf-8a97-1d63-8ebb-9c61d22539cb@denninger.net> In-Reply-To: <e6a682a1-322e-a677-3d5e-0a7a503ebd40@denninger.net> References: <f4ccb904-63fd-4641-89c8-09357fbb5a1c@denninger.net> <CAG6CVpUZumZaU9xVcri1Ry8=C6j6JrjX5F6qd3oKatYZXFu6Kg@mail.gmail.com> <e6a682a1-322e-a677-3d5e-0a7a503ebd40@denninger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Oh, my apologies -- I didn't include the version:
FreeBSD 11.0-STABLE #0 r313159M: Fri Feb 3 09:58:35 CST 2017
On an RPI2, but I doubt that matters.
On 11/20/2017 14:02, Karl Denninger wrote:
> root@Test-MCP:/home/karl/HD-MCP # cd /mnt
> root@Test-MCP:/mnt # mount
> /dev/ufs/rootfs on / (ufs, local, noatime, soft-updates, nfsv4acls)
> devfs on /dev (devfs, local)
> tmpfs on /tmp (tmpfs, local)
> /dev/da0s1 on /mnt (msdosfs, local)
> root@Test-MCP:/mnt # ls -al
> total 408
> drwxr-xr-x 1 hdmcp wheel 4096 Jan 1 1980 .
> drwxr-xr-x 20 root wheel 512 Nov 20 16:04 ..
> drwxr-xr-x 1 hdmcp wheel 4096 Nov 19 11:20 System Volume Information
> -rwxr-xr-x 1 hdmcp wheel 127979 Nov 19 22:54
> cam2-2017-11-19-22-54-47.jpg
> -rwxr-xr-x 1 hdmcp wheel 271295 Nov 19 22:57
> cam2-2017-11-19-22-57-20.jpg
> root@Test-MCP:/mnt # chmod u-w *
> root@Test-MCP:/mnt # ls -al
> total 408
> drwxr-xr-x 1 hdmcp wheel 4096 Jan 1 1980 .
> drwxr-xr-x 20 root wheel 512 Nov 20 16:04 ..
> drwxr-xr-x 1 hdmcp wheel 4096 Nov 19 11:20 System Volume Information
> -rwxr-xr-x 1 hdmcp wheel 127979 Nov 19 22:54
> cam2-2017-11-19-22-54-47.jpg
> -rwxr-xr-x 1 hdmcp wheel 271295 Nov 19 22:57
> cam2-2017-11-19-22-57-20.jpg
> root@Test-MCP:/mnt #
>
> Nope. The "w" is still there.
>
> No error returned from the "chmod" command (or if I call it from a C
> program) but the file mode is NOT changed whether I'm doing it as the
> superuser or as the owner of the file (and directory)
>
> On 11/20/2017 12:30, Conrad Meyer wrote:
>> Hi Karl,
>>
>> In fact, msdosfs in FreeBSD should set the FAT READONLY attribute
>> under two conditions:
>>
>> 1. The owner chmod's the file non-writeable (chmod u-w) (what you've
>> described, I think). Or,
>> 2. The super user or otherwise privileged user sets the "readonly"
>> flag on the file via chflags(1).
>>
>> How have you determined that chmod u-w does nothing? What version of
>> FreeBSD are you using?
>>
>> Best,
>> Conrad
>>
>>
>> On Mon, Nov 20, 2017 at 7:36 AM, Karl Denninger <karl@denninger.net> wrote:
>>> I'm running into an interesting issue here and wondering if there's a
>>> way to do this under FreeBSD.
>>>
>>> MSDOS filesystems have a "primitive" permission capability;
>>> specifically, they can have a "Read-only" attribute on a file. It looks
>>> like OpenBSD supports this from reading their man pages.
>>>
>>> FreeBSD doesn't appear to. When you mount a msdos filesystem (e.g. a
>>> USB stick) whoever owns the parent directory where you mount it gives
>>> you the permissions and "ownership" of files on said filesystem. All
>>> good so far. But attempting to chmod a file to remove write permission
>>> "succeeds" (returns success) but does nothing.
>>>
>>> Is this capability simply not present on FreeBSD? I'm interested in
>>> using it as a means of "flagging" files on a USB stick in an application
>>> that I do not want to remove if the stick fills (basically, to "protect"
>>> them from being aged off) and it appears there's no way to do it, other
>>> than to use something unique in the filename that I would then have to
>>> pay attention to.
>>>
>>> --
>>> Karl Denninger
>>> karl@denninger.net <mailto:karl@denninger.net>
>>> /The Market Ticker/
>>> /[S/MIME encrypted email preferred]/
--
Karl Denninger
karl@denninger.net <mailto:karl@denninger.net>
/The Market Ticker/
/[S/MIME encrypted email preferred]/
[-- Attachment #2 --]
0 *H
010
`He 0 *H
00 H^Ōc!5
H0
*H
010 UUS10UFlorida10U Niceville10U
Cuda Systems LLC10UCuda Systems CA1!0UCuda Systems LLC 2017 CA0
170817164217Z
270815164217Z0{10 UUS10UFlorida10U
Cuda Systems LLC10UCuda Systems CA1%0#UCuda Systems LLC 2017 Int CA0"0
*H
0
h-5B>[;olӴ0~͎O9}9Ye*$g!ukvʶLzN`jL>MD'7U 45CB+kY`bd~b*c3Ny-78ju]9HeuέsӬDؽmgwER?&UURj'}9nWD i`XcbGz \gG=u%\Oi13ߝ4
K44pYQr]Ie/r0+eEޝݖ0C15Mݚ@JSZ(zȏ NTa(25DD5.l<g[[ZarQQ%Buȴ~~`IohRbʳڟu2MS8EdFUClCMaѳ !}ș+2k/bųE,n当ꖛ\(8WV8 d]b yXw ܊:I39
00U]^§Q\ӎ0U#0T039N0b010 UUS10UFlorida10U Niceville10U
Cuda Systems LLC10UCuda Systems CA1!0UCuda Systems LLC 2017 CA @Ui0U0 0U0
*H
:P U!>vJnio-#ן]WyujǑR̀Q
nƇ!GѦFg\yLxgw=OPycehf[}ܷ['4ڝ\[p 6\o.B&JF"ZC{;*o*mcCcLY߾`
t*S!(`]DHP5A~/NPp6=mhk밣'doA$86hm5ӚS@jެEgl
)0JG`%k35PaC?σ
׳HEt}!P㏏%*BxbQwaKG$6h¦Mve;[o-Iی&
I,Tcߎ#t wPA@l0P+KXBպT zGv;NcI3&JĬUPNa?/%W6G۟N000 k#Xd\=0
*H
0{10 UUS10UFlorida10U
Cuda Systems LLC10UCuda Systems CA1%0#UCuda Systems LLC 2017 Int CA0
170817212120Z
220816212120Z0W10 UUS10UFlorida10U
Cuda Systems LLC10Ukarl@denninger.net0"0
*H
0
T[I-ΆϏ dn;Å@שy.us~_ZG%<MYd\gvfnsa1'6Egyjs"C [{~_K Pn+<*pv#Q+H/7[-vqDV^U>f%GX)H.|l`M(Cr>е͇6#odc"YljҦln8@5SA0&ۖ"OGj?UDWZ5 dDB7k-)9Izs-JAv
J6L$Ն1SmY.Lqw*SH;EF'DĦH]MOgQQ|Mٙג2Z9y@y]}6ٽeY9Y2xˆ$T=eCǺǵbn֛{j|@LLt1[Dk5:$= ` M 00<+00.0,+0 http://ocsp.cudasystems.net:88880 U0 0 `HB0U0U%0++03 `HB
&$OpenSSL Generated Client Certificate0U%՞V=;bzQ0U#0]^§Q\ӎϡ010 UUS10UFlorida10U Niceville10U
Cuda Systems LLC10UCuda Systems CA1!0UCuda Systems LLC 2017 CA H^Ōc!5
H0U0karl@denninger.net0
*H
۠A0-j%--$%g2#ޡ1^>{K+uGEv1ş7Af&b&O;.;A5*U)ND2bF|\=]<sˋL!wrw٧>YMÄ3\mWR hSv!_zvl? 3_ xU%\^#O*Gk̍YI_&Fꊛ@&1n } ͬ:{hTP3B.;bU8:Z=^Gw8!k-@xE@i,+'Iᐚ:fhztX7/(hY` O.1}a`%RW^akǂpCAufgDix UTЩ/7}%=jnVZvcF<M=
2^GKH5魉
_O4ެByʈySkw=5@h.0z>
W1000{10 UUS10UFlorida10U
Cuda Systems LLC10UCuda Systems CA1%0#UCuda Systems LLC 2017 Int CA k#Xd\=0
`He E0 *H
1 *H
0 *H
1
171120200812Z0O *H
1B@h{)S}:S8˸&Bk.şBށ_IwCzʔ\-s
0l *H
1_0]0 `He*0 `He0
*H
0*H
0
*H
@0+0
*H
(0 +7100{10 UUS10UFlorida10U
Cuda Systems LLC10UCuda Systems CA1%0#UCuda Systems LLC 2017 Int CA k#Xd\=0*H
10{10 UUS10UFlorida10U
Cuda Systems LLC10UCuda Systems CA1%0#UCuda Systems LLC 2017 Int CA k#Xd\=0
*H
{U£&b.VPtrNfx
.xy!˅#
oyʵT^
s_FMw噁cBH܃JԖhSǞe*,Ě#IMg&?E @s݃&dx㉢aLjiB?m
\f(BVM/JF w{벇8j~r/h&úv<rn63t
L Ww5KmhV6b<(?Ǝ'
a*~jWN,pUm|K Ҭ%yK%'X!~9&((y_䜦;{.f'i7x+#`sLRsþ15K+<835HE2b؎<E۬CWGMmJo:Zu/ڋ#BtZ?$Fn ܮ3,w;+9HR6H>;oZɽPfw{gMExQ
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0e31a0cf-8a97-1d63-8ebb-9c61d22539cb>
