Date: Thu, 3 Jul 2025 21:24:57 +0200 From: Willem Jan Withagen <wjw@digiware.nl> To: Rick Macklem <rick.macklem@gmail.com>, Shawn Webb <shawn.webb@hardenedbsd.org> Cc: FreeBSD CURRENT <freebsd-current@freebsd.org> Subject: Re: RFC: checking file systems support UF_HIDDEN, UF_SYSTEM Message-ID: <3a05b953-cfba-4cd2-a1ea-22348702563f@digiware.nl> In-Reply-To: <CAM5tNy5Cm=YhUkhXsA=O5ha-om7h5MQk3_SuLFjgZX_EA5ShkA@mail.gmail.com> References: <CAM5tNy5eoY5f-fo9BKc4v34XKXF6%2B6Ae7Zpq=FH7owaSRYSHmw@mail.gmail.com> <5emcw3uocuaenm2lwdrqqvxgiqpo7uazon6y2hzelhi5qjxxj4@trymutqekdiy> <CAM5tNy5Cm=YhUkhXsA=O5ha-om7h5MQk3_SuLFjgZX_EA5ShkA@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On 2-7-2025 23:45, Rick Macklem wrote:
> I don't know why or when these were added to FreeBSD, but I believe
> their origin is in MSDOS long ago. The fat file system had these two flags
> that MSDOS used, called "hiiden" and "system".
> I believe "hidden" is somewhat similar to POSIX file
> names that start with "." and "system" made the file harder to delete.
> (But, I hate to admit I even recall anything about MSDOS;-)
>
> If you google "windows system and hidden" you'll get something that
> might answer your question, thanks to their AI
This happens when you grow old, memory starts acting up. ;-)
I even wrote a CPM and DOS driver for a wierd HD controller we had lying
around from some
Unix projects. (5 MB disks.)
But in MS-DOS the system flag was for files that were needed by the DOS
system
and should not be deleted easily, so basically files were hidden and not
deletable....
But with the right tools the flag was easily removed. (anybody remember
Norton disk editor?)
In essence it was a rather useless flag, it looked interesting but did
very little.
Once Long FileNames on FAT were created that was indicated by ORing all
flags...
READ_ONLY=0x01 HIDDEN=0x02 SYSTEM=0x04 VOLUME_ID=0x08 DIRECTORY=0x10 ARCHIVE=0x20 LFN=READ_ONLY|HIDDEN|SYSTEM|VOLUME_ID
So not sure it that would be of interest in representing a FAT
filesystem over NFS4
This is from an MS-DOS manual I had in my archives:
In MS-DOS, the "system" file attribute, when set, indicates that a file
is a critical system file required by the operating system.These files
are typically hidden from casual access and should not be deleted,
renamed, or moved without specific knowledge of the potential consequences.
Here's a more detailed explanation:
*
*System Attribute:*
This attribute is part of the file's metadata and tells the
operating system that the file is essential for its proper functioning.
*
*Hidden from View:*
Files with the system attribute set are usually hidden from standard
directory listings (like when you use the |DIR| command).
*
*Protection:*
The system attribute helps prevent accidental modification or
deletion of crucial files, ensuring the operating system remains stable.
*
*Examples:*
Files like |IO.SYS|, |MSDOS.SYS|, and |COMMAND.COM| in MS-DOS are
typically marked with the system attribute.
*
*Advanced Users:*
While the system attribute offers protection, advanced users can
still access and manipulate these files using specific commands or
tools, but this is generally not recommended unless you understand
the implications.
--WjW
[-- Attachment #2 --]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<br>
<br>
<div class="moz-cite-prefix">On 2-7-2025 23:45, Rick Macklem wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAM5tNy5Cm=YhUkhXsA=O5ha-om7h5MQk3_SuLFjgZX_EA5ShkA@mail.gmail.com">
<pre wrap="" class="moz-quote-pre">I don't know why or when these were added to FreeBSD, but I believe
their origin is in MSDOS long ago. The fat file system had these two flags
that MSDOS used, called "hiiden" and "system".
I believe "hidden" is somewhat similar to POSIX file
names that start with "." and "system" made the file harder to delete.
(But, I hate to admit I even recall anything about MSDOS;-)
If you google "windows system and hidden" you'll get something that
might answer your question, thanks to their AI
</pre>
</blockquote>
<br>
This happens when you grow old, memory starts acting up. ;-)<br>
I even wrote a CPM and DOS driver for a wierd HD controller we had
lying around from some<br>
Unix projects. (5 MB disks.)<br>
<br>
But in MS-DOS the system flag was for files that were needed by the
DOS system<br>
and should not be deleted easily, so basically files were hidden and
not deletable.... <br>
But with the right tools the flag was easily removed. (anybody
remember Norton disk editor?) <br>
<br>
In essence it was a rather useless flag, it looked interesting but
did very little.<br>
<br>
Once Long FileNames on FAT were created that was indicated by ORing
all flags...<br>
<pre>READ_ONLY=0x01 HIDDEN=0x02 SYSTEM=0x04 VOLUME_ID=0x08 DIRECTORY=0x10 ARCHIVE=0x20 LFN=READ_ONLY|HIDDEN|SYSTEM|VOLUME_ID</pre>
So not sure it that would be of interest in representing a FAT
filesystem over NFS4<br>
<br>
This is from an MS-DOS manual I had in my archives:<br>
<br>
<span data-huuid="10451617558015645918"><span>In MS-DOS, the
"system" file attribute, when set, <mark class="QVRyCf">indicates
that a file is a critical system file required by the
operating system</mark>.</span><span> </span></span><span
data-huuid="10451617558015645155"><span>These files are typically
hidden from casual access and should not be deleted, renamed, or
moved without specific knowledge of the potential consequences.</span><span
class="pjBG2e" data-cid="eb6c5798-f0a8-4ee6-8463-f54a7347bdbe"><span
class="UV3uM"> </span></span></span>
<div class="WaaZC">
<div class="RJPOee EIJn2" style="animation: none !important;">
<div class="rPeykc" data-hveid="CAMQAQ"
data-ved="2ahUKEwjGwvXWsaGOAxWNygIHHRFmLLEQo_EKegQIAxAB"> </div>
</div>
</div>
<div class="WaaZC">
<div class="RJPOee EIJn2" style="animation: none !important;">
<div class="rPeykc uP58nb" data-hveid="CAsQAQ"
data-ved="2ahUKEwjGwvXWsaGOAxWNygIHHRFmLLEQo_EKegQICxAB"> <span
data-huuid="17786328557009452547"><span aria-level="2"
role="heading">Here's a more detailed explanation:</span><span
class="pjBG2e"
data-cid="83804c93-5e7f-4264-be48-464d9d4f9c6d"><span
class="UV3uM"> </span></span></span></div>
</div>
</div>
<div class="WaaZC">
<div class="RJPOee EIJn2" style="animation: none !important;">
<div class="rPeykc uP58nb" data-hveid="CAsQAQ"
data-ved="2ahUKEwjGwvXWsaGOAxWNygIHHRFmLLEQo_EKegQICxAB"> </div>
</div>
</div>
<div class="WaaZC">
<div class="RJPOee EIJn2" style="animation: none !important;">
<ul data-hveid="CBwQAQ"
data-ved="2ahUKEwjGwvXWsaGOAxWNygIHHRFmLLEQm_YKegQIHBAB">
<li class="K3KsMc">
<div class="zMgcWd dSKvsb" data-il="">
<div data-crb-p="">
<div class="xFTqob">
<div class="Gur8Ad"><span
data-huuid="17786328557009451134"><span><strong>System
Attribute:</strong></span><span> </span></span></div>
<div class="vM0jzc"><span
data-huuid="17786328557009450663"><span>This
attribute is part of the file's metadata and
tells the operating system that the file is
essential for its proper functioning.</span><span>
</span></span></div>
</div>
</div>
</div>
</li>
<li class="K3KsMc">
<div class="zMgcWd dSKvsb" data-il="">
<div data-crb-p="">
<div class="xFTqob">
<div class="Gur8Ad"><span
data-huuid="17786328557009449721"><span><strong>Hidden
from View:</strong></span><span> </span></span></div>
<div class="vM0jzc"><span
data-huuid="17786328557009449250"><span>Files with
the system attribute set are usually hidden from
standard directory listings (like when you use
the <code class="mv6bHd">DIR</code> command).</span><span>
</span></span></div>
</div>
</div>
</div>
</li>
<li class="K3KsMc">
<div class="zMgcWd dSKvsb" data-il="">
<div data-crb-p="">
<div class="xFTqob">
<div class="Gur8Ad"><span
data-huuid="17786328557009452404"><span><strong>Protection:</strong></span><span>
</span></span></div>
<div class="vM0jzc"><span
data-huuid="17786328557009451933"><span>The system
attribute helps prevent accidental modification
or deletion of crucial files, ensuring the
operating system remains stable.</span><span> </span></span></div>
</div>
</div>
</div>
</li>
<li class="K3KsMc">
<div class="zMgcWd dSKvsb" data-il="">
<div data-crb-p="">
<div class="xFTqob">
<div class="Gur8Ad"><span
data-huuid="17786328557009450991"><span><strong>Examples:</strong></span><span>
</span></span></div>
<div class="vM0jzc"><span
data-huuid="17786328557009450520"><span>Files like
<code class="mv6bHd">IO.SYS</code>, <code
class="mv6bHd">MSDOS.SYS</code>, and <code
class="mv6bHd">COMMAND.COM</code> in MS-DOS
are typically marked with the system attribute.</span><span>
</span></span></div>
</div>
</div>
</div>
</li>
<li class="K3KsMc">
<div class="zMgcWd dSKvsb" data-il="">
<div data-crb-p="">
<div class="xFTqob">
<div class="Gur8Ad"><span
data-huuid="17786328557009449578"><span><strong>Advanced
Users:</strong></span><span> </span></span></div>
<div class="vM0jzc"><span
data-huuid="17786328557009449107"><span>While the
system attribute offers protection, advanced
users can still access and manipulate these
files using specific commands or tools, but this
is generally not recommended unless you
understand the implications.</span></span></div>
</div>
</div>
</div>
</li>
</ul>
<p>--WjW<br>
</p>
</div>
</div>
</body>
</html>
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a05b953-cfba-4cd2-a1ea-22348702563f>
