[Solved] umask ignored by GUI applications

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
cyberpatrol
Posts: 13
Joined: 26. Dec 2012, 01:27

[Solved] umask ignored by GUI applications

Post by cyberpatrol »

I have another problem. I want to keep the default umask 022 global and for root, but want to set umask 077 for unprivileged users. So I set umask 077 in the users' ~/.bashrc. Every console application respects this umask, but not the GUI applications like LibreOffice, Leafpad, etc. Those GUI applications still save new files with umask 022.

So my question is: Where do I have to set umask for those applications or what do I have to change that those applications respect the umask from ~/.bashrc, too?

/etc/profile and /etc/login.defs are out of the question, because they set the global umask, and aren't respected by those GUI applications, too.
Last edited by cyberpatrol on 2. Feb 2013, 02:32, edited 1 time in total.
User avatar
aurlaent
Donor
Posts: 106
Joined: 1. Feb 2012, 19:46
Location: Sydney, Australia

Re: umask ignored by GUI applications

Post by aurlaent »

I notice that you've solved this over at linux questions.
cyberpatrol
Posts: 13
Joined: 26. Dec 2012, 01:27

Re: umask ignored by GUI applications

Post by cyberpatrol »

Right. I just didn't get around to post the solution here and mark this thread as solved, too. ;)

To get the right umask for GUI applications the line ". $HOME/.bashrc" has to be added to /etc/xdg/xfce4/xinitrc.

Maybe this should be added officially in the appropriate package(s) by default. This can be a security or at least a privacy issue on real multi user systems. At least I found no way to do it in the user's home directory.
User avatar
windowsxp
Posts: 52
Joined: 23. Sep 2009, 18:43

Re: [Solved] umask ignored by GUI applications

Post by windowsxp »

Hi,

a little up ....

to get the right umask for GUI applications the line ". $HOME/.bashrc" has to be added to /etc/xdg/xfce4/xinitrc.

Because where in xinitrc ?
cyberpatrol
Posts: 13
Joined: 26. Dec 2012, 01:27

Re: [Solved] umask ignored by GUI applications

Post by cyberpatrol »

Right before the line

Code: Select all

# run xfce4-session if installed
You probably can add it at the beginning of the file, after the first line, of course. I haven't tested this.
User avatar
windowsxp
Posts: 52
Joined: 23. Sep 2009, 18:43

Re: [Solved] umask ignored by GUI applications

Post by windowsxp »

Hi,

thank .

i put here :

# run xfce4-session if installed

. $HOME/.bashrc

if which xfce4-session >/dev/null 2>&1; then

# check if we start xfce4-session with ck-launch-session. this is only
# required for starting from a console, not a login manager
if test "x$XFCE4_SESSION_WITH_CK" = "x1"; then
if which ck-launch-session >/dev/null 2>&1; then
ck-launch-session xfce4-session
else
echo
echo "You have tried to start Xfce with consolekit support, but"
echo "ck-launch-session is not installed."
echo "Aborted startup..."
echo

exit 1
fi
else
# start xfce4-session normally
xfce4-session
fi

exit 0
fi

I think it 's good ?

. $HOME/.bashrc use space in . and $ ?

Voilà .
cyberpatrol
Posts: 13
Joined: 26. Dec 2012, 01:27

Re: [Solved] umask ignored by GUI applications

Post by cyberpatrol »

windowsxp wrote:i put here :

# run xfce4-session if installed

. $HOME/.bashrc

if which xfce4-session >/dev/null 2>&1; then
Looks good. I have it there, too, well, before the comment, but that's technically irrelevant.
windowsxp wrote:. $HOME/.bashrc use space in . and $ ?
Right. "." is a substitution for the command "source".
Post Reply