Bug 20410
Summary: | RFE: mount dirs with permissions of the device | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Gerald Teschl <gt> | ||||||||
Component: | autofs | Assignee: | Nalin Dahyabhai <nalin> | ||||||||
Status: | CLOSED NOTABUG | QA Contact: | Brock Organ <borgan> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 7.2 | CC: | leonb | ||||||||
Target Milestone: | --- | Keywords: | FutureFeature | ||||||||
Target Release: | --- | ||||||||||
Hardware: | i386 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Enhancement | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2002-05-25 13:18:58 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Gerald Teschl
2000-11-06 08:55:50 UTC
Created attachment 21385 [details]
Automount script that copies the device permissions
I just attached a script ``auto.mnt" that works with autofs to mount the removable devices under ./mnt. The script scans the fstab file for entries with a matching mount point and options "user" and "noauto". It also understand option "owner" and interprets it by adding a "uid=" and "gid=" in such a way that the filesystem owner matches the device owner. % ls -l /mnt/floppy total 48 -rw-r--r-- 1 leonb floppy 46194 Jun 19 17:24 arbib.tgz -rw-r--r-- 1 leonb floppy 252 Jun 19 18:03 auto.master -rw-r--r-- 1 leonb floppy 1561 Jun 20 06:26 auto.mnt Created attachment 21386 [details]
Fixed version (previous had garbage after the doc)
I currently use Take/GiveConsole to do a similar thing: MYUID=`id -u $USER` MYGID=`id -g $USER` sed "s/uid=[0-9]*/uid=$MYUID/g;s/gid=[0-9]*/gid=$MYGID/g" /etc/auto.mnt > /etc/auto.mnt. mv -f /etc/auto.mnt. /etc/auto.mnt > I currently use Take/GiveConsole to do a similar thing.
My auto.mnt is not a data file but an executable script.
There is no need to replicate the list of removable devices.
It only uses the usual fstab entries to determine the mount
line and make everything happens. That includes the insertion
of the uid= and gid= option (when option "owner" is specified).
For instance, inserting /etc/auto.mnt and the corresponding
/etc/auto.master line in the autofs-xxx.rpm would make linux mount
all removeable devices listed in fstab on demand, with the
proper uid/gid options. No configuration necessary.
- L.
Created attachment 21850 [details]
Autofs script that automounts devices with correct ownership
Just attached an improved version of the script. This version relies less on bash oddities and works properly when the user does not own the device. I think the proper way to solve this is by adding an option to mount which causes the fs to be mounted with the permissions of the device. See #45166 |