Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Nov 2017 10:30:42 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        Karl Denninger <karl@denninger.net>
Cc:        "freebsd-fs@freebsd.org" <freebsd-fs@freebsd.org>
Subject:   Re: MSDOS Filesystem question related to "read-only" files
Message-ID:  <CAG6CVpUZumZaU9xVcri1Ry8=C6j6JrjX5F6qd3oKatYZXFu6Kg@mail.gmail.com>
In-Reply-To: <f4ccb904-63fd-4641-89c8-09357fbb5a1c@denninger.net>
References:  <f4ccb904-63fd-4641-89c8-09357fbb5a1c@denninger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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]/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpUZumZaU9xVcri1Ry8=C6j6JrjX5F6qd3oKatYZXFu6Kg>