cd9660: Apply the file and directory mode masks bits to all 12 access bits

This permits the mask bits to control the upper 3 bits used for setuid,
setgid, and sticky permissions.  While here, clarify the manpage language
as non-Rockridge volumes with extended attributes can also supply users
and groups along with permissions.

Reviewed by:	olce
Fixes:		82f2275b73 cd9660: Add support for mask,dirmask,uid,gid options
Differential Revision:	https://reviews.freebsd.org/D47357
This commit is contained in:
John Baldwin 2024-12-06 17:40:35 -05:00
parent 8f7835acc6
commit c1ad5b4b10
2 changed files with 13 additions and 12 deletions

View file

@ -73,30 +73,31 @@ version number.
.It Fl G Ar group
Set the group of the files in the file system to
.Ar group .
The default gid on non-Rockridge volumes is zero.
The default gid on volumes without extended attributes or Rockridge extensions
is zero.
.It Fl U Ar user
Set the owner of the files in the file system to
.Ar user .
The default uid on non-Rockridge volumes is zero.
The default uid on volumes without extended attributes or Rockridge extensions
is zero.
.It Fl m Ar mask
Specify the maximum file permissions for files
in the file system.
(For example, a
For example, a
.Ar mask
of
.Li 755
specifies that, by default, the owner should have
read, write, and execute permissions for files, but
others should only have read and execute permissions).
.Li 544
limits the owner to
read and execute permissions for files and
others to only read permission.
See
.Xr chmod 1
for more information about octal file modes.
Only the nine low-order bits of
.Ar mask
are used.
The default
.Ar mask
on non-Rockridge volumes is 755.
is 7777.
The default permissions on volumes without extended attributes or Rockridge
extensions is 555.
.It Fl M Ar mask
Specify the maximum file permissions for directories
in the file system.

View file

@ -394,7 +394,7 @@ iso_mountfs(struct vnode *devvp, struct mount *mp)
isomp->im_mountp = mp;
isomp->im_dev = dev;
isomp->im_devvp = devvp;
isomp->im_fmask = isomp->im_dmask = ACCESSPERMS;
isomp->im_fmask = isomp->im_dmask = ALLPERMS;
vfs_flagopt(mp->mnt_optnew, "norrip", &isomp->im_flags, ISOFSMNT_NORRIP);
vfs_flagopt(mp->mnt_optnew, "gens", &isomp->im_flags, ISOFSMNT_GENS);