From nobody Wed Jul 02 21:54:45 2025 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bXYbR2fVPz6107x for ; Wed, 02 Jul 2025 21:54:59 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bXYbQ43SLz4Dt6 for ; Wed, 02 Jul 2025 21:54:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=OUAHLJk4; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::12c as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org; dmarc=none Received: by mail-il1-x12c.google.com with SMTP id e9e14a558f8ab-3de2b02c69eso29454725ab.1 for ; Wed, 02 Jul 2025 14:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1751493292; x=1752098092; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=YeoFyL9+vK6j++C2QF8A/ZPBAYXBRR+nPzr3SVOuh1w=; b=OUAHLJk4OvRSlGegjWW+lVnzUb+rjrXxSxT2lCgIWvf7z4dxeKwGChfIT2XKMpaz8O +ql3V/zJd4hbIF77i9KmcJaA5AnZEaL/evBWU3ve0+NFyBUPdW0AAIuc0Dp2TOds0jRC 5tZO/+kFVc794E+6DVP+frNpsYo6qNXD7/k/DyIDSgrKlG2IfZ9rSran6ea6hPMmYVgQ j5nzVcjbjWPtIorkE5ISGKP929OEpx9BDcibEvD686n2AQDgiV8HSOzscNgVr33qv868 GWyS7pOxorG5J53z04CxeGvXWWs6VknlQajb3oDqkemLPsVgErBlpYdIQ1fPjCzXfsFp G3RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751493292; x=1752098092; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YeoFyL9+vK6j++C2QF8A/ZPBAYXBRR+nPzr3SVOuh1w=; b=cSjF3JvNBQMC/8Dfu40GGd+AYknQRn6RE2MMxgrVLsAGKsnavIG95cc+uFTtwkc4WS PbsW6Te7MGL/UeA2VeBCllFIeBrwuwrB5K5WB3vzdwk5U/erejONTrgxh9ijGQyRmK1T PPMucwtznNYbWbySledLO0Ea2T5Tc62QAjZIgdwDCkMM5ukUrgg/SANEiYXE5+6/JLVZ W/rxrUwv5yCfqBAZwomBYhRyws2MttTuMqIHuu4PdjdRKhRdaKmgjQFWAYOAhaiR4Pgs WrwaH3z81tAAlKM83h9REAO46Icgh5tPEs2eXmdPWn9a20Q0byP98F59Er1TbQSal72p n9Mg== X-Gm-Message-State: AOJu0YyIP7l6GZEeOSqKpSdYVvZ3OaDxjC7MSUKbzCptLiyVriTBpPEU G8uTkSaSzuVAFHxhSTVnwlF1D/RXyuFriq5R+1zJA3+kBKONc4mG6zBzMSJINIndI7w= X-Gm-Gg: ASbGncvzzAEUjPNIYmsxXduL0QBdlxhn/hVZtNqtuNbYBGAIHvynkfXyHvqC2dQY3vP +duPythR//nR26G3Za7itWPKgw7Y1dIEdEX5/rVaFucX5+vMqAaq+qviUiErRbV6EZs4anNZo+d Gz65kwi9NSczJPIJsl7j5R7+oSkd/aqYXhmVeO560zz+XBzsYC8Tzswu+J5Dxtp9SDEbcv3gsGQ f7mn9c5sMWlWC7OxWYkRN2aZrRAlSOncZhaWRf6wpez0vTYPyN3a0dk6VSJPOmugpN2uR0q1mHH JCdBLIsAORJ5OXJmL3NBCW2IloAQHYJFKSclIBDSsIYO X-Google-Smtp-Source: AGHT+IH+FqFwdxKHd39hBb6yb46KFPFLpzX87iLG0jxOAsjY4S56DvMdZRmh2a+UlCYH+2eqs0gQ1w== X-Received: by 2002:a05:6602:6d11:b0:862:fe54:df4e with SMTP id ca18e2360f4ac-876c6a2d1ccmr692310639f.7.1751493287124; Wed, 02 Jul 2025 14:54:47 -0700 (PDT) Received: from mutt-hbsd ([2001:470:4001:1::95]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-50204a557b8sm3126143173.89.2025.07.02.14.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jul 2025 14:54:46 -0700 (PDT) Date: Wed, 2 Jul 2025 21:54:45 +0000 From: Shawn Webb To: Rick Macklem Cc: FreeBSD CURRENT Subject: Re: RFC: checking file systems support UF_HIDDEN, UF_SYSTEM Message-ID: X-Operating-System: FreeBSD mutt-hbsd 14.3-STABLE-HBSD FreeBSD 14.3-STABLE-HBSD HARDENEDBSD-14-STABLE amd64 X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <5emcw3uocuaenm2lwdrqqvxgiqpo7uazon6y2hzelhi5qjxxj4@trymutqekdiy> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="77xlxkpitobljazy" Content-Disposition: inline In-Reply-To: X-Spamd-Result: default: False [-4.52 / 15.00]; SIGNED_PGP(-2.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.42)[-0.418]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; ARC_NA(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; DMARC_NA(0.00)[hardenedbsd.org]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TAGGED_RCPT(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::12c:from] X-Rspamd-Queue-Id: 4bXYbQ43SLz4Dt6 X-Spamd-Bar: ---- --77xlxkpitobljazy Content-Type: text/plain; protected-headers=v1; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: Re: RFC: checking file systems support UF_HIDDEN, UF_SYSTEM MIME-Version: 1.0 On Wed, Jul 02, 2025 at 02:45:58PM -0700, Rick Macklem wrote: > On Wed, Jul 2, 2025 at 2:05=E2=80=AFPM Shawn Webb wrote: > > > > 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") !=3D 0 || > > > strcmp(vp->v_mount->mnt_vfc->vfc_name, "ufs") !=3D 0 || > > > strcmp(vp->v_mount->mnt_vfc->vfc_name, "msdosfs") !=3D 0 || > > > strcmp(vp->v_mount->mnt_vfc->vfc_name, "tmpfs") !=3D 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? > 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;-) >=20 > If you google "windows system and hidden" you'll get something that > might answer your question, thanks to their AI. >=20 > W.r.t. NFSv4, the current interest is from the group that is working > on the Windows NFSv4.1 client. That explains a lot. Thanks for the explanation! --=20 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/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --77xlxkpitobljazy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmhlqp4ACgkQ/y5nonf4 4foo5g/9FrXyHQTjkmr6KFw8y6vj8mQzjzsh6bcfLVBSf5FNOlhVB40Pgb/Upy6C qTMYXIUPRE5i0mHGG+zJ4OtEkT06XCvC9ozA1mU+yd0ireMf1UM+scjmYRJt6S/j CmnZL4Vn76ZJaQXSVvIK4E7de3bMdOEgBPjyhBRH72bIHIqkyBq27uDh05HNLev2 7T3NlEbpAWeViiKRP6PnVO5IBwgh0KCbvA/Izwhlem1E+lfP8jajsSEuQv7CyllF gktI9sPBgQAmtPTp/Pa9/80/P9A0yn9TWX3eq3CvWQLIVmHRISVEo0zKsWCYpGdv HJbyvJSjpYzncL8xq5eBr3N9i3onPK+cUyelPk14kq3p/GHG+LlelJjtBwUHSXbT 4/UoWOh/nxUQnqWsa6B+hY6zshHpzvAlHx65GmztHu7dUaManfa0xAmUDsqdMX73 jHtAGEYXh+BL0AqEbM0+js/mjyYqtwQCEAzEiytsDDwF/suKN3Ol3r/upr9u6pLl RzUFE32Yvp5qdQJESQGYbPlTb0Svu8kxWRLewYzJJ4BS7bqtzBLnZ58py90J4PM3 ByYUILL3fK/ryQgJI2IYuAS9OlqlwQKMBwwV1/S8DV7ung4Nl/LXuYiw8qiGhd2l XS/w+q2n47UOqWTizn09TSQm/qTz/DbE/S/ofqw4u8OlFmtGx4M= =LxQw -----END PGP SIGNATURE----- --77xlxkpitobljazy--