Bug 20410 - RFE: mount dirs with permissions of the device
RFE: mount dirs with permissions of the device
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: autofs (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Brock Organ
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-06 03:55 EST by Gerald Teschl
Modified: 2007-04-18 12:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-05-25 09:18:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Automount script that copies the device permissions (4.12 KB, text/bash)
2001-06-20 11:00 EDT, leonb
no flags Details
Fixed version (previous had garbage after the doc) (4.01 KB, text/x-bash)
2001-06-20 11:34 EDT, leonb
no flags Details
Autofs script that automounts devices with correct ownership (4.01 KB, text/plain)
2001-06-26 10:23 EDT, leonb
no flags Details

  None (edit)
Description Gerald Teschl 2000-11-06 03:55:50 EST
The RedHat login scripts make sure that several devices (like floppy
drives)
belong to the console user. I'd like to use autofs for floppy drives and
it would be nice if the floppy would be mounted with the owner permissions
(rather than root).

(I also sent this request to Peter Alvin.)
Comment 1 leonb 2001-06-20 11:00:25 EDT
Created attachment 21385 [details]
Automount script that copies the device permissions
Comment 2 leonb 2001-06-20 11:03:34 EDT
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

Comment 3 leonb 2001-06-20 11:34:10 EDT
Created attachment 21386 [details]
Fixed version (previous had garbage after the doc)
Comment 4 Gerald Teschl 2001-06-20 14:43:47 EDT
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
Comment 5 leonb 2001-06-20 16:55:55 EDT
> 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.
Comment 6 leonb 2001-06-26 10:23:03 EDT
Created attachment 21850 [details]
Autofs script that automounts devices with correct ownership
Comment 7 leonb 2001-06-26 10:24:32 EDT
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.

Comment 8 Gerald Teschl 2002-05-25 09:18:52 EDT
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

Note You need to log in before you can comment on or make changes to this bug.