Bug 114955 - [cd9660] [patch] [request] support for mask,dirmask,uid,gid for mount_cd9660(8) / CD9660
Summary: [cd9660] [patch] [request] support for mask,dirmask,uid,gid for mount_cd9660(...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-27 09:20 UTC by Ighighi
Modified: 2017-08-27 04:15 UTC (History)
1 user (show)

See Also:


Attachments
file.txt (9.33 KB, text/plain)
2007-07-27 09:20 UTC, Ighighi
no flags Details
cd9660-head.patch (8.28 KB, patch)
2007-07-27 09:29 UTC, Ighighi
no flags Details | Diff
cd9660_dirmask.patch (9.49 KB, patch)
2007-07-29 07:50 UTC, Ighighi
no flags Details | Diff
cd9660-head.patch (8.42 KB, patch)
2007-07-29 08:00 UTC, Ighighi
no flags Details | Diff
cd9660.patch (10.72 KB, patch)
2007-08-02 04:06 UTC, Ighighi
no flags Details | Diff
cd9660-head.patch (9.47 KB, patch)
2007-08-02 04:15 UTC, Ighighi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ighighi 2007-07-27 09:20:01 UTC
This patch adds arbitrary mask, dirmask, uid & gid support to ISO9660
ala MSDOSFS. It is necessary because legitimate data in CD-ROM and ISO
images may be inaccessible when ownership is assigned to root/wheel.
The mask/dirmask options let the user override the ugly 0555 permissions
of files where the executable bit makes no sense.

Successfully built & tested on 6.2-STABLE with patch to -CURRENT pending.
The mount_cd9660(8) in -CURRENT that uses nmount() instead of the old mount()
ran successfully too.

Fix: To apply this patch, run:
  patch -d /usr < /path/do/patch
Now, either rebuild the world and the kernel or run:
  cd /usr/src/sys/modules/cd9660
  make clean obj depend && make && make install clean
  cp -f /sys/isofs/cd9660/iso.h /usr/include/isofs/cd9660/
  cp -f /sys/isofs/cd9660/cd9660_mount.h /usr/include/isofs/cd9660/
  cd /usr/src/sbin/mount_cd9660
  make clean obj depend && make && make install clean
  kldunload -v cd9660
  kldload -v cd9660

 Enjoy, you may use a line like this in /etc/fstab:
  /dev/cdrom /media/cdrom cd9660 ro,noauto,nosuid,-m644,-M755 0 0
 From the command line:
  mount_cd9660 -o ro -m 660 -M 750 -U `whoami` -G staff /dev/cdrom ~/cdrom


Patch attached with submission follows:
Comment 1 Ighighi 2007-07-27 09:29:13 UTC
NOTE: This version applies to -CURRENT

This patch adds arbitrary mask, dirmask, uid & gid support to ISO9660
ala MSDOSFS. It is necessary because legitimate data in CD-ROM and ISO
images may be inaccessible when ownership is assigned to root/wheel.
The mask/dirmask options let the user override the ugly 0555 permissions
of files where the executable bit makes no sense.

To apply this patch, run:
   patch -d /usr < /path/do/patch
Now, either rebuild the world and the kernel or run:
   cd /usr/src/sys/modules/cd9660
   make clean obj depend && make && make install clean
   cp -f /sys/fs/cd9660/iso.h /usr/include/fs/cd9660/
   cp -f /sys/fs/cd9660/cd9660_mount.h /usr/include/fs/cd9660/
   cd /usr/src/sbin/mount_cd9660
   make clean obj depend && make && make install clean
   kldunload -v cd9660
   kldload -v cd9660

  Enjoy, you may use a line like this in /etc/fstab:
   /dev/cdrom /media/cdrom cd9660 ro,noauto,nosuid,-m644,-M755 0 0
  From the command line:
   mount_cd9660 -o ro -m 660 -M 750 -U `whoami` -G staff /dev/cdrom ~/cdrom
Comment 2 Ighighi 2007-07-29 07:50:04 UTC
This patch addresses a bug in the previous commit for RELENG_6 that made 
the newly added options mandatory.

Also, an "umount -a -t cd9660" was missing from the following instructions:

To apply this patch, run:
   patch -d /usr < /path/do/patch
  Now, either rebuild the world and the kernel or run:
   cd /usr/src/sys/modules/cd9660
   make clean obj depend && make && make install clean
   cp -f /sys/isofs/cd9660/iso.h /usr/include/isofs/cd9660/
   cp -f /sys/isofs/cd9660/cd9660_mount.h /usr/include/isofs/cd9660/
   cd /usr/src/sbin/mount_cd9660
   make clean obj depend && make && make install clean
   umount -a -t cd9660
   kldunload -v cd9660
   kldload -v cd9660
Comment 3 Ighighi 2007-07-29 08:00:05 UTC
This patch addresses a bug in the previous commit for -CURRENT that made
the newly added options mandatory (though the new nmount() call made it
a non-issue with mount_cd9660(8)

Also, an "umount -a -t cd9660" was missing from the following instructions:

To apply this patch, run:
    patch -d /usr < /path/do/patch
   Now, either rebuild the world and the kernel or run:
    cd /usr/src/sys/modules/cd9660
    make clean obj depend && make && make install clean
    cp -f /sys/isofs/cd9660/iso.h /usr/include/isofs/cd9660/
    cp -f /sys/isofs/cd9660/cd9660_mount.h /usr/include/isofs/cd9660/
    cd /usr/src/sbin/mount_cd9660
    make clean obj depend && make && make install clean
    umount -a -t cd9660
    kldunload -v cd9660
    kldload -v cd9660

Comment 4 Ighighi 2007-08-02 04:06:17 UTC
This new version (for RELENG_6) allows overriding Rockridge uid/gid,
file and directory permissions ala MSDOS.

To apply this patch, run:
    patch -d /usr < /path/do/patch
Now, either rebuild the world and the kernel or run:
    cd /usr/src/sys/modules/cd9660
    make clean obj depend && make && make install clean
    cp -f /sys/isofs/cd9660/iso.h /usr/include/isofs/cd9660/
    cp -f /sys/isofs/cd9660/cd9660_mount.h /usr/include/isofs/cd9660/
    cd /usr/src/sbin/mount_cd9660
    make clean obj depend && make && make install clean
    umount -a -t cd9660
    kldunload -v cd9660
    kldload -v cd9660


You may now add the following line to /etc/fstab:
/dev/acd0 /media/cdrom ro,noauto,nosuid,nodev,-m640,-M750,-Uuser,-Ggroup 0 0

Or run mount_cd9660(8) as:
mount_cd9660 -o ro,nosuid,nodev -m640 -M750 -U`whoami` -G`id -g`

Enjoy ;)
Comment 5 Ighighi 2007-08-02 04:15:14 UTC
This new version (for -CURRENT) allows overriding Rockridge uid/gid,
file and directory permissions ala MSDOS.

To apply this patch, run:
     patch -d /usr < /path/do/patch
Now, either rebuild the world and the kernel or run:
     cd /usr/src/sys/modules/cd9660
     make clean obj depend && make && make install clean
     cp -f /sys/isofs/cd9660/iso.h /usr/include/isofs/cd9660/
     cp -f /sys/isofs/cd9660/cd9660_mount.h /usr/include/isofs/cd9660/
     cd /usr/src/sbin/mount_cd9660
     make clean obj depend && make && make install clean
     umount -a -t cd9660
     kldunload -v cd9660
     kldload -v cd9660


You may now add the following line to /etc/fstab:
/dev/acd0 /media/cdrom ro,noauto,nosuid,nodev,-m640,-M750,-Uuser,-Ggroup 0 0

Or run mount_cd9660(8) as:
mount_cd9660 -o ro,nosuid,nodev -m640 -M750 -U`whoami` -G`id -g`

Enjoy ;)
Comment 6 Robert Watson freebsd_committer freebsd_triage 2008-03-09 12:59:00 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainers.