Index | Thread | Search

From:
Alexander Hall <alexander@beard.se>
Subject:
Re: [patch] mount_mfs allow setting permissions manually
To:
tech@openbsd.org, Crystal Kolipe <kolipe.c@exoticsilicon.com>, Rafael Sadowski <rafael@sizeofvoid.org>
Date:
Thu, 24 Jul 2025 23:59:00 +0200

Download raw body.

Thread
On July 24, 2025 9:50:52 PM GMT+02:00, Crystal Kolipe <kolipe.c@exoticsilicon.com> wrote:

>Does anyone have any more opinions on this?  Any further OKs?

I just wanted to add my $.02 worth of bikeshed paint for two slight inconsistencies I find with this, and a boring solution.

1. With -p, you supply the permissions, but the user and group parts are still taken from the underlying mount point. Allowing specifying also user and group and/or default them to root:wheel might make sense.

2. Not being able to specify the permission 0 without having it being silently ignored also feels wrong. Either accept it or fail.

And lastly,

3. Could not all this be done already, by using -P and an empty skeleton directory somewhere with the proper permissions? 

/Alexander 

>
>--- newfs.8.orig	Mon Apr  7 04:25:02 2025
>+++ newfs.8	Thu Jul 24 20:35:55 2025
>@@ -67,6 +67,7 @@
> .Op Fl m Ar free-space
> .Op Fl O Ar filesystem-format
> .Op Fl o Ar options
>+.Op Fl p Ar mode
> .Op Fl P Ar file
> .Op Fl s Ar size
> .Ar special node
>@@ -270,7 +271,8 @@
> are as described for
> .Nm ,
> except for the
>-.Fl o
>+.Fl o ,
>+.Fl p
> and
> .Fl P
> options.
>@@ -284,6 +286,11 @@
> See the
> .Xr mount 8
> man page for possible options and their meanings.
>+.It Fl p Ar mode
>+Set permissions on the mount point after the mfs filesystem has been mounted.
>+The
>+.Ar mode
>+argument must be specified in octal notation.
> .It Fl P Ar file
> If
> .Ar file
>@@ -295,9 +302,11 @@
> contents of the FFS file system contained on the device.
> .El
> .Pp
>-If the
>+If neither of the
>+.Fl p Ar mode
>+or
> .Fl P Ar file
>-option is not used, the owner and mode of the created mfs file
>+options is used, the owner and mode of the created mfs file
> system will be the same as the owner and mode of the mount point.
> .Sh ENVIRONMENT
> .Bl -tag -width COLUMNS
>@@ -308,6 +317,11 @@
> .Nm
> defaults to the terminal width, or 80 columns if the output is not a terminal.
> .El
>+.Sh EXAMPLES
>+The following line added to /etc/fstab will mount a 512MB mfs filesystem on
>+/tmp at boot time, setting appropriate permissions:
>+.Pp
>+.Dl swap /tmp mfs rw,nodev,nosuid,-s=512m,-p=01777 0 0
> .Sh SEE ALSO
> .Xr disktab 5 ,
> .Xr fs 5 ,
>