Page 1 of 1

[Solved] umask ignored by GUI applications

Posted: 1. Feb 2013, 20:02
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.

Re: umask ignored by GUI applications

Posted: 2. Feb 2013, 02:21
by aurlaent
I notice that you've solved this over at linux questions.

Re: umask ignored by GUI applications

Posted: 2. Feb 2013, 02:32
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.

Re: [Solved] umask ignored by GUI applications

Posted: 5. Feb 2013, 11:07
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 ?

Re: [Solved] umask ignored by GUI applications

Posted: 5. Feb 2013, 11:23
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.

Re: [Solved] umask ignored by GUI applications

Posted: 5. Feb 2013, 11:53
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Ă  .

Re: [Solved] umask ignored by GUI applications

Posted: 5. Feb 2013, 12:04
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".