Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Force permissions.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Sun Jan 22, 2012 6:15 am    Post subject: Force permissions. Reply with quote

Is there any way to force specific permissions for files and directories separately even if it has been copied from somewhere else?
_________________
My blog
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Sun Jan 22, 2012 10:38 am    Post subject: Reply with quote

Or a better solutions maybe -- set default permissions for mounting optical media and USB fat/ntfs storage devices.
_________________
My blog
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Jan 22, 2012 11:01 am    Post subject: Reply with quote

You can set umask, dmask, fmask options for FAT. Not sure about other filesystems, man mount will tell.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Tue Jan 24, 2012 4:43 am    Post subject: Reply with quote

Not from fstab. I was wondering about doing the same for hotplugging CD/DVD/block devices.
_________________
My blog
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Jan 24, 2012 10:56 am    Post subject: Reply with quote

dE_logics wrote:
Not from fstab.

Not sure what you mean by that, I'm using fmask=133 in fstab for my USB sticks.
dE_logics wrote:
I was wondering about doing the same for hotplugging CD/DVD/block devices.
http://reactivated.net/writing_udev_rules.html#ownership
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Tue Jan 24, 2012 2:38 pm    Post subject: Reply with quote

Jaglover wrote:
dE_logics wrote:
Not from fstab.

Not sure what you mean by that, I'm using fmask=133 in fstab for my USB sticks.


You have listed fstab like -

/dev/sr0
/dev/sdb
/dev/sdc
/dev/sdd
etc...
?

dE_logics wrote:
I was wondering about doing the same for hotplugging CD/DVD/block devices.
http://reactivated.net/writing_udev_rules.html#ownership[/quote]

This changes the permission of the device node, not the mounted FS (?).
_________________
My blog
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue Jan 24, 2012 2:46 pm    Post subject: Reply with quote

Code:
/dev/sdc1               /media/stick    vfat            noatime,users,noauto,fmask=133,shortname=lower  0 0

That's one line from my fstab.

You are correct about udev, the only other idea I can come up with is to run a post-mount script that sets ownership and permissions.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2289
Location: $TERM

PostPosted: Wed Jan 25, 2012 4:27 pm    Post subject: Reply with quote

This fstab method is actually a workaround. It should be handled with udisks which's the proper way.

The major problem with the default permissions is that in multiuser systems where FS is shared and you've set groups as common among them (so they may have correct rw regardless of the user owning the files); only the user who copies the content form the external device to the shared filesystem has write access, otherwise everyone else has ro access, cause the permissions are g-w.

This causes inconvenience to the very end users.
_________________
My blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum