From nobody Wed Jul 2 21:45:58 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 4bXYPL1zdMz60yRs for ; Wed, 02 Jul 2025 21:46:14 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 4bXYPK6swhz47D3 for ; Wed, 02 Jul 2025 21:46:13 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-60789b450ceso9289102a12.2 for ; Wed, 02 Jul 2025 14:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751492772; x=1752097572; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6LEScSbPYS008iGx4dRyHl/fZlxeV5talBuQGhSQLSU=; b=FEfbaH5jBbK9gHcgCkd7rzbqMgXbUMAqQ+4IFHAIk8XEYr6HVHiLk+0nonAtfH9kKj ESWOMIyULCR8+8NL470HhRAJ6FzaZH2vkSLxOMr3zCuWPMpdNQ3KBnR63pyGZjDzleRB vlx3ftm34X6p5qBmRxlH6noBxczq4S/QZTvqXM2JO2QOlhr1RK2kuscAh1Sd6R11/xEY lJoafit7npGND3D75z5CrAIyAA6D227+SIQVs5toT4B6z0JT3JhHAuEVbDc9hWmesa2c FnCB2NnK0spBuEObGHRwNxgPnVftEISeA+FI6ry9mS+Df9+OyWwR4euTfAkwbjWysKxK ej5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751492772; x=1752097572; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6LEScSbPYS008iGx4dRyHl/fZlxeV5talBuQGhSQLSU=; b=HQYin4S+61gZlzGqxNzfXuw8Tg6eHiVo/W0weYo/CaEW1xyZxgd4N+aEFHJRmdZTvm qcVDim7fpA5rrJGPocRgltO6dVMpaa1D236+Fq3P68cfuEdoMrmJpuxVLA5+2Vb5qOAH FW/R5Nxl4UnnBzXBl60nD2n7jH8cBTTM2FAAPV4kPUb+iQW46kHiSnt5ZZrxImlUbEEU CdgkfaO1rtLg+Bf+pJZT9ElMEc/GB3d0cLFJ+UWZMkNTfyXQo4Erntuqx6+tdbLjcYWR Mg6ajoVLE0DaOYrNExTljWJmnjUTxvgCanZxZG0DJn7AeMWjlKhTLoIo57e1LAKp1ya/ ZGQA== X-Gm-Message-State: AOJu0YzOtvkqbRt04Z/TZVdCLXHcypqnPd0TD08EybfM+szZabWKEJfp ChBHwROyP72vMUfIGeA6CyCyw6sm1ddcrs+nmBAwVuWhES9i1impqJeSF2pIvyjLawXcRbf/KKn i1arq2R3nRYXZYo0V1xc6EIiNIvKYKSZ9 X-Gm-Gg: ASbGnct1T0Gg7Ayj4z2GHcruxJHYr1Jyh9utUKCfoZtcdultbM6rbTSPiI7u8C5rlVt iGR1TAPXpgth5t1ZI+p4DggvYpRALMcLZY1mejYJ7B/cm8jVys/ki068XRDsswMoxUl0Y6cwipX c0TAHZTO2OTlf09bdAUzsl5SS0P7ar8Ycc/ELd/RxCvLEJDIGVOm4xlIYu2xU6D0DUa+40mEUsu d4= X-Google-Smtp-Source: AGHT+IE0HzNBvWQ4DhOiA9SjS7SK7ORvzyinDfkT6/zNnXtUkL7JuNtFgK1v4VZ9QTbFOYI2XQ9xxjcmGcFZ10CzHe8= X-Received: by 2002:a17:907:7ea0:b0:ae3:5e70:32fc with SMTP id a640c23a62f3a-ae3d84f782emr88055466b.29.1751492771315; Wed, 02 Jul 2025 14:46:11 -0700 (PDT) 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 References: <5emcw3uocuaenm2lwdrqqvxgiqpo7uazon6y2hzelhi5qjxxj4@trymutqekdiy> In-Reply-To: <5emcw3uocuaenm2lwdrqqvxgiqpo7uazon6y2hzelhi5qjxxj4@trymutqekdiy> From: Rick Macklem Date: Wed, 2 Jul 2025 14:45:58 -0700 X-Gm-Features: Ac12FXzUG9EFGgz5qHmKYAswPePAhcL2bGquGqWYUZvdS4fr3gT0TUyaLQ8tL5g Message-ID: Subject: Re: RFC: checking file systems support UF_HIDDEN, UF_SYSTEM To: Shawn Webb Cc: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bXYPK6swhz47D3 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] 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;-) If you google "windows system and hidden" you'll get something that might answer your question, thanks to their AI. W.r.t. NFSv4, the current interest is from the group that is working on the Windows NFSv4.1 client. rick > > 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/0= 3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc