Bug 20410 - RFE: mount dirs with permissions of the device
Summary: RFE: mount dirs with permissions of the device
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autofs
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-06 08:55 UTC by Gerald Teschl
Modified: 2007-04-18 16:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-05-25 13:18:58 UTC
Embargoed:


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

Description Gerald Teschl 2000-11-06 08:55:50 UTC
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 15:00:25 UTC
Created attachment 21385 [details]
Automount script that copies the device permissions

Comment 2 leonb 2001-06-20 15:03:34 UTC
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 15:34:10 UTC
Created attachment 21386 [details]
Fixed version (previous had garbage after the doc)

Comment 4 Gerald Teschl 2001-06-20 18:43:47 UTC
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 20:55:55 UTC
> 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 14:23:03 UTC
Created attachment 21850 [details]
Autofs script that automounts devices with correct ownership

Comment 7 leonb 2001-06-26 14:24:32 UTC
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 13:18:52 UTC
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.