Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Setting per-user umask for user without a shell?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
saturnalia0
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2016
Posts: 134

PostPosted: Thu Oct 13, 2016 5:54 pm    Post subject: [SOLVED] Setting per-user umask for user without a shell? Reply with quote

I set up a sandbox user for Firefox following the guide from the wiki:

https://wiki.gentoo.org/wiki/Simple_sandbox

I want to change the umask for this user only, such that new files/dirs created by the sandbox user have group write permissions (for my normal user to be able to delete files created by the sandbox user). However, the sandbox user has no shell, so I can't do it on /home/ff/.bashrc or something like that, and /etc/login.defs or /etc/pam.d/login affects *all* users, whereas I just want to change the umask for the sandbox user. How could I do this?


Last edited by saturnalia0 on Fri Oct 14, 2016 2:02 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Fri Oct 14, 2016 1:43 am    Post subject: Reply with quote

Users do not have umasks. Processes have umasks. The simplest way to achieve your goal would be to use a wrapper script that sets the desired umask, then does exec /usr/bin/firefox "$@". Then run that script instead of running Firefox directly.
Back to top
View user's profile Send private message
saturnalia0
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2016
Posts: 134

PostPosted: Wed Oct 26, 2016 6:29 am    Post subject: Reply with quote

Thanks. I read some manuals and now I understand how it works. I ended up setting it on `/etc/sudoers.d/ff` since I only use `sudo` for that:

Code:

me ALL=(ff) NOPASSWD: ALL
Defaults:me umask_override
Defaults:me umask=007
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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