View previous topic :: View next topic |
Author |
Message |
Adrien.D Apprentice
Joined: 18 Jan 2015 Posts: 157
|
Posted: Sun Dec 16, 2018 5:34 pm Post subject: Fix rights on ext4 partition with GUI applications |
|
|
Hi Gentoo users !
I have a problem.
On my computer (with MATE Desktop) I have 2 users : adrien and adeline.
I have a second hard disk (/dev/sdb1) formated with ext4.
Adrien have primary group adrien.
Adeline have primary group adeline.
Adrien and adeline are in the "nous" groupe ("nous" is in french the translation of "us" )
How can i mount my /dev/sdb1 in /media/DATA mount point to :
- adrien can create files with user adrien and group "nous"
- adeline can create files with user adeline and group "nous"
- permissions of all files are rw for user AND group to allow adrien modify files of adeline and adeline modify files of adrien (because there are in the "nous" group
I try to use guid and umask option on fstab but it works only with FAT partitions.
I try to set the permission of the mount point /media/DATA to 775 and the directory have "nous" group, but for this moment, on solution works.
Do you have an idea ?
Thanks _________________ Desktop : MSI Gaming Pro X470 - AMD Ryzen 5 2600X - RX 560 - OpenRC GNOME - gentoo-sources-6.1 LTS
Server : Acer Barebone - Intel i3-8100T - OpenRC CLI - gentoo-sources-5.4 LTS
VMs : A lot of VMS to practice Gentoo of course (proxmox, virtualbox) |
|
Back to top |
|
|
Maitreya Guru
Joined: 11 Jan 2006 Posts: 441
|
Posted: Sun Dec 16, 2018 8:03 pm Post subject: |
|
|
There are several ways one could approach this:
1. set-gid
2. ACL
3. inotify script
4. Samba "force user"
etc.
set-gid being the simplest imho. |
|
Back to top |
|
|
Adrien.D Apprentice
Joined: 18 Jan 2015 Posts: 157
|
Posted: Sun Dec 16, 2018 8:26 pm Post subject: |
|
|
Yes, I tryed set-gid.
But if the folder created and i set the group owner to "nous", there are not with full rights (only read and not write)
I must change the umask but it's not applicable in GUI mode when files created by applications in graphical user interface.
I tested solution number 2 :
Code: | chgrp -R nous folder
chmod -R 0775 folder
setfacl -m d:group:nous:rw folder
|
But it works only if it's the primary group ? _________________ Desktop : MSI Gaming Pro X470 - AMD Ryzen 5 2600X - RX 560 - OpenRC GNOME - gentoo-sources-6.1 LTS
Server : Acer Barebone - Intel i3-8100T - OpenRC CLI - gentoo-sources-5.4 LTS
VMs : A lot of VMS to practice Gentoo of course (proxmox, virtualbox) |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21619
|
Posted: Sun Dec 16, 2018 8:52 pm Post subject: |
|
|
All processes have a umask. It is not restricted to console programs. You might have a problem finding how to set the umask in a GUI process if the author left out a dialog to set it, but unless that process actively resets the umask, you can fix this by setting the umask in the parent process before forking to create the GUI process. |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2004
|
Posted: Mon Dec 17, 2018 9:44 am Post subject: |
|
|
Adrien.D wrote: | Yes, I tryed set-gid.
But if the folder created and i set the group owner to "nous", there are not with full rights (only read and not write)
I must change the umask but it's not applicable in GUI mode when files created by applications in graphical user interface.
... |
Which GUI?
I have a similar but more specific problem with KDE. I wanted a folder shared between two users, so that both users could put files into the folder, and both users read all the files in the folder. I tried creating the folder using setgid; it worked properly if the users move files using the command line, but not using drag and drop in the KDE desktop. It turns out to be a bug in KIOSlaves. I suspect they had to add a lot of code to make it go wrong! _________________ Greybeard |
|
Back to top |
|
|
Adrien.D Apprentice
Joined: 18 Jan 2015 Posts: 157
|
Posted: Mon Dec 17, 2018 7:08 pm Post subject: |
|
|
I have the problem with MATE.
Code: | setfacl -R -m d:group:nous:rw folder |
it works for the moment _________________ Desktop : MSI Gaming Pro X470 - AMD Ryzen 5 2600X - RX 560 - OpenRC GNOME - gentoo-sources-6.1 LTS
Server : Acer Barebone - Intel i3-8100T - OpenRC CLI - gentoo-sources-5.4 LTS
VMs : A lot of VMS to practice Gentoo of course (proxmox, virtualbox) |
|
Back to top |
|
|
|