Re: RFC: checking file systems support UF_HIDDEN, UF_SYSTEM
Date: Wed, 02 Jul 2025 21:05:53 UTC
On Wed, Jul 02, 2025 at 02:02:14PM -0700, Rick Macklem wrote: > Hi, > > I am implementing the "hidden" and "system" attributes for > NFSv4 using UF_HIDDEN and UF_SYSTEM. > > In a couple of places in the code, I need to know if a file > system supports these flags. > I can think of two ways to do this. > #1 - Create a new VFCF_HIDSYS flag that is set via VFS_SET() > for file systems that support the UF_HIDDEN and UF_SYSTEM > flags and test for that flag being set. > or > #2 - Write it this way... > if (strcmp(vp->v_mount->mnt_vfc->vfc_name, "zfs") != 0 || > strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") != 0 || > strcmp(vp->v_mount->mnt_vfc->vfc_name, "msdosfs") != 0 || > strcmp(vp->v_mount->mnt_vfc->vfc_name, "tmpfs") != 0) > > Which do you think is preferable (or do you have another idea)? I have no skin in the game, but I'm curious if you could tell me more about UF_HIDDEN. Can you explain what that is or perhaps link me to some documentation for me to read? Thanks, -- Shawn Webb Cofounder / Security Engineer HardenedBSD Signal Username: shawn_webb.74 Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc