Re: How to change default umask in Stretch?

2017-08-12 Thread Jonathan de Boyne Pollard
Henrique de Moraes Holschuh: > Note that the ideal implementation would 
be to inherit the umask [...] Jonathan de Boyne Pollard: > Actually, the 
ideal implementation from the GNOME point of view would be for > these 
programs to pass the umask from the client process to the server, just > 
like they pass open file handles, the working directory, environment > 
variables (including DISPLAY), and the arguments vector. > > 
* https://github.com/GNOME/gnome-terminal/blob/52f32f962a5ed34f8c31042f2f8276dc1710cc99/src/terminal.c#L317 
> 
* https://github.com/GNOME/glib/blob/b51a0e7c63313ecfc0c6bbb9f2a8d99f193e51ea/gio/gapplication.c#L923 
Henrique de Moraes Holschuh: > You'd have to always indirectly start an 
intermediate "gnome launcher" > thing (instead of the real program) that 
sets up the environment, then > exec the real program for that to work. 
No, that would not be necessary at all. Think about how GNOME Terminal 
and GNOME Editor work. As I said: These are already passing a whole 
bunch of process state from the client to the server, in order to 
preserve things like the apparent semantics of GNOME Terminal windows 
"inheriting" the working directories of the invoking clients, when in 
reality there is no inheritance from those client processes going on at 
all. This would be just one more such item of process state.




Re: How to change default umask in Stretch?

2017-08-12 Thread Henrique de Moraes Holschuh
On Sat, 12 Aug 2017, Jonathan de Boyne Pollard wrote:
> Henrique de Moraes Holschuh:
> > Note that the ideal implementation would be to inherit the umask [...]
> 
> Actually, the ideal implementation from the GNOME point of view would be for
> these programs to pass the umask from the client process to the server, just
> like they pass open file handles, the working directory, environment
> variables (including DISPLAY), and the arguments vector.

You'd have to always indirectly start an intermediate "gnome launcher"
thing (instead of the real program) that sets up the environment, then
exec the real program for that to work.

-- 
  Henrique Holschuh



Re: How to change default umask in Stretch?

2017-08-12 Thread Jonathan de Boyne Pollard

Henrique de Moraes Holschuh:


Note that the ideal implementation would be to inherit the umask [...]



Actually, the ideal implementation from the GNOME point of view would be 
for these programs to pass the umask from the client process to the 
server, just like they pass open file handles, the working directory, 
environment variables (including DISPLAY), and the arguments vector.


* 
https://github.com/GNOME/gnome-terminal/blob/52f32f962a5ed34f8c31042f2f8276dc1710cc99/src/terminal.c#L317


* 
https://github.com/GNOME/glib/blob/b51a0e7c63313ecfc0c6bbb9f2a8d99f193e51ea/gio/gapplication.c#L923




Re: How to change default umask in Stretch?

2017-08-12 Thread Jonathan de Boyne Pollard

Greg Wooledge:


It's beginning to sound like GNOME applications aren't even launched 
by GNOME at all, but rather by systemd/dbus. Somehow.




GNOME Editor and other GIO applications work like how 16-bit Windows 
applications used to work.


GNOME Terminal goes yet farther and not even the first instance is the 
originally invoked process.  All instances, even the first, are 
"bus-activated".  Depending from whether there is a per-user instance of 
systemd or not, there may be a further level of indirection.


Of course, in the case where "bus activation" is configured to at least 
pass things over to some proper per-user service management, the place 
to set the ulimit for the likes of GNOME Terminal is in the per-user 
service definition for GNOME Terminal server.  With the nosh per-user 
service mangement, this would be the 
$HOME/.config/service-bundles/services/gnome-terminal-server/service/run 
program.  With systemd per-user service management this would be a 
$HOME/.config/systemd/gnome-terminal-server.service.d/ulimit.conf 
override for /usr/lib/systemd/user/gnome-terminal-server.service .


With nosh per-user service management, there is a 
$HOME/.config/service-bundles/services/gedit service, which one can 
start before attempting to run the first GNOME Editor instance; which 
would permit one to place ulimit and suchlike modifications in 
$HOME/.config/service-bundles/services/gedit/service/run .  Vanilla 
GNOME Editor does not attempt to plumb into systemd's per-user service 
management, as GNOME Terminal does; so there is no systemd equivalent here.


* https://news.ycombinator.com/item?id=13056252

* https://unix.stackexchange.com/a/323700/5132

* https://unix.stackexchange.com/questions/201900/

* 
http://jdebp.info./Softwares/nosh/avoid-dbus-bus-activation.html#InheritedLimits


* http://jdebp.info./Softwares/nosh/guide/per-user-dbus-demand-start.html



Re: How to change default umask in Stretch?

2017-08-09 Thread Reco
Hi.

An update for the archives.

On Wed, 9 Aug 2017 08:09:16 -0400
Greg Wooledge  wrote:

> On Tue, Aug 08, 2017 at 01:27:02PM +0300, Reco wrote:
> > Or find gnome-session (or gnome-shell - I don't recall who exactly
> > spawns user applications in GNOME) process pid, execute something like
> > this on login:
> > 
> > gdb -p $(pidof gnome-session) -ex 'p umask(0077)' --batch
> > 
> > You'll need gdb to be installed, of course.
> 
> It's beginning to sound like GNOME applications aren't even launched
> by GNOME at all, but rather by systemd/dbus.  Somehow.

Couple of experiments later, which involved strace, ltrace *and*
auditctl I confirm that GNOME applications are launched by dbus-daemon
indeed. Not 'system' one, but 'session' dbus-daemon.
If you do it via gnome-shell anyway.


> I'd be interested in hearing the results of your gdb experiment being
> performed on the user session dbus daemon process, by someone using
> GNOME.  I have no idea whether it would actually work, but if it does,
> that would help us understand how this... desktop... is put together.

So, once I pinpointed spawning process, I poked it with gdb and it
changed the umask. So, correct hack for the umask in GNOME (as of
stretch) is:

gdb -p $(pgrep -U $(id -u) -f '/usr/bin/dbus-daemon --fork') \
-ex 'p umask(0077)' --batch

Reco



Re: How to change default umask in Stretch?

2017-08-09 Thread Garrett R.
Found this. Reuben Thomas reported this earlier in the year. Lot of guys 
tracked down PIDs.

https://bugzilla.gnome.org/show_bug.cgi?id=780622


- Original Message -
From: "Reco" <recovery...@gmail.com>
To: debian-user@lists.debian.org
Sent: Tuesday, August 8, 2017 6:27:02 AM
Subject: Re: How to change default umask in Stretch?

Or find gnome-session (or gnome-shell - I don't recall who exactly
spawns user applications in GNOME) process pid, execute something like
this on login:

gdb -p $(pidof gnome-session) -ex 'p umask(0077)' --batch

On Mon, Aug 07, 2017 at 03:47:48PM -0500, David Wright wrote:
> On Mon 07 Aug 2017 at 20:00:10 (+), Garrett R. wrote:
> > Does anybody know, this gnome/systemd bug of umask, it this something that 
> > I will have to wait for Debian 10 before it is fixed? Or will Debian 9 
> > implement a fix when/if gnome/systemd issues a fix?
> > 
> > I was hoping to be able to move to Stretch, but it's looking unlikely now.
> 
> My suggestion is simple, but would be tedious to implement. I use it
> to run a program as a different user, overriding their default umask.
> 
> /home/other/bin/my-program.sh contains
> 
> #!/bin/bash
> umask u=rwx,go=
> /usr/bin/real-program "$@"
> 
> But it's tedious to have to replace real-program by 
> /home/other/bin/my-program.sh
> in all the places it/they might get called from. I only have to do
> this once (in .bashrc) because I'm a bash/xterm/fvwm guy using
> bash functions.

Or find gnome-session (or gnome-shell - I don't recall who exactly
spawns user applications in GNOME) process pid, execute something like
this on login:

gdb -p $(pidof gnome-session) -ex 'p umask(0077)' --batch

You'll need gdb to be installed, of course.

Reco



Re: How to change default umask in Stretch?

2017-08-09 Thread Greg Wooledge
On Tue, Aug 08, 2017 at 01:27:02PM +0300, Reco wrote:
> Or find gnome-session (or gnome-shell - I don't recall who exactly
> spawns user applications in GNOME) process pid, execute something like
> this on login:
> 
> gdb -p $(pidof gnome-session) -ex 'p umask(0077)' --batch
> 
> You'll need gdb to be installed, of course.

It's beginning to sound like GNOME applications aren't even launched
by GNOME at all, but rather by systemd/dbus.  Somehow.

I'd be interested in hearing the results of your gdb experiment being
performed on the user session dbus daemon process, by someone using
GNOME.  I have no idea whether it would actually work, but if it does,
that would help us understand how this... desktop... is put together.



Re: How to change default umask in Stretch?

2017-08-08 Thread Reco
Hi.

On Mon, Aug 07, 2017 at 03:47:48PM -0500, David Wright wrote:
> On Mon 07 Aug 2017 at 20:00:10 (+), Garrett R. wrote:
> > Does anybody know, this gnome/systemd bug of umask, it this something that 
> > I will have to wait for Debian 10 before it is fixed? Or will Debian 9 
> > implement a fix when/if gnome/systemd issues a fix?
> > 
> > I was hoping to be able to move to Stretch, but it's looking unlikely now.
> 
> My suggestion is simple, but would be tedious to implement. I use it
> to run a program as a different user, overriding their default umask.
> 
> /home/other/bin/my-program.sh contains
> 
> #!/bin/bash
> umask u=rwx,go=
> /usr/bin/real-program "$@"
> 
> But it's tedious to have to replace real-program by 
> /home/other/bin/my-program.sh
> in all the places it/they might get called from. I only have to do
> this once (in .bashrc) because I'm a bash/xterm/fvwm guy using
> bash functions.

Or find gnome-session (or gnome-shell - I don't recall who exactly
spawns user applications in GNOME) process pid, execute something like
this on login:

gdb -p $(pidof gnome-session) -ex 'p umask(0077)' --batch

You'll need gdb to be installed, of course.

Reco



Re: How to change default umask in Stretch?

2017-08-07 Thread Henrique de Moraes Holschuh
On Mon, 07 Aug 2017, Garrett R. wrote:
> Does anybody know, this gnome/systemd bug of umask, it this something
> that I will have to wait for Debian 10 before it is fixed? Or will
> Debian 9 implement a fix when/if gnome/systemd issues a fix?

It is too early to tell.  It depends on how complex the systemd changes
would be.

Suppose they're "simple enough".  One could then backport these changes
to stretch's systemd, *test them throughoutly* -- and by that I do mean
do a very, very good job of that *and* also of reporting it -- and then
propose that the changes be accepted into a stretch point release.

So, yes, it could happen, but someone has to do the work.  I suggest
writing the patch for systemd upstream and trying to get it (or some
other solution) merged as the first step.

Note that the ideal implementation would be to inherit the umask from
whatever was set by pam or by the user's login shell as one of the
possibilities (and have that as the default, actually).  However, I am
not sure this is straightforward: it depends on how "systemd --user"
launching of user-session services works...

-- 
  Henrique Holschuh



Re: How to change default umask in Stretch?

2017-08-07 Thread David Wright
On Mon 07 Aug 2017 at 20:00:10 (+), Garrett R. wrote:
> Does anybody know, this gnome/systemd bug of umask, it this something that I 
> will have to wait for Debian 10 before it is fixed? Or will Debian 9 
> implement a fix when/if gnome/systemd issues a fix?
> 
> I was hoping to be able to move to Stretch, but it's looking unlikely now.

My suggestion is simple, but would be tedious to implement. I use it
to run a program as a different user, overriding their default umask.

/home/other/bin/my-program.sh contains

#!/bin/bash
umask u=rwx,go=
/usr/bin/real-program "$@"

But it's tedious to have to replace real-program by 
/home/other/bin/my-program.sh
in all the places it/they might get called from. I only have to do
this once (in .bashrc) because I'm a bash/xterm/fvwm guy using
bash functions.

Cheers,
David.



Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
Does anybody know, this gnome/systemd bug of umask, it this something that I 
will have to wait for Debian 10 before it is fixed? Or will Debian 9 implement 
a fix when/if gnome/systemd issues a fix?

I was hoping to be able to move to Stretch, but it's looking unlikely now.

- Original Message -
From: "Dejan Jocic" <jode...@gmail.com>
To: "Garrett R." <grtrbs...@unseen.is>
Cc: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 2:32:30 PM
Subject: Re: How to change default umask in Stretch?

On 07-08-17, Garrett R. wrote:
> No effect.
> 
> I added  "session optional pam_umask.so umask=0077" to the end of 
> /etc/pam.d/common-session. Then I confirmed /etc/login.defs has a umask 
> entry. Then I logged out and back in.
> 
> A new gedit document still reports permission rw-r--r--.
> 


Unfortunately. It looks like it is systemd thing indeed, according to
this: 

https://unix.stackexchange.com/questions/254378/how-to-set-umask-for-the-entire-gnome-session#254923

and this

https://github.com/systemd/systemd/issues/6077

It also looks like it does not have workaround. Except to touch file
from terminal before editing it in gedit( if it is login shell, for
gnome-terminal edit > profile preferences > command > run command as
login shell ). Or even better launch gedit from that terminal, it will
have right umask settings. Or, make custom shortcut that will launch
terminal and gedit from it at same time, something like gnome-terminal
-e gedit. Sorry, but not much more help with systemd involved, I'm
afraid.



Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
So if I want to use Gnome, I'm stuck on Jessie until this Pottering guy and 
Gnome get off their asses and fix this mess?

This is a long established linux item missing complete functionality. There 
should be a lot more priority in fixing it than Pottering and Gnome are giving 
it.

- Original Message -
From: "Dejan Jocic" <jode...@gmail.com>
To: "Garrett R." <grtrbs...@unseen.is>
Cc: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 2:32:30 PM
Subject: Re: How to change default umask in Stretch?

On 07-08-17, Garrett R. wrote:
> No effect.
> 
> I added  "session optional pam_umask.so umask=0077" to the end of 
> /etc/pam.d/common-session. Then I confirmed /etc/login.defs has a umask 
> entry. Then I logged out and back in.
> 
> A new gedit document still reports permission rw-r--r--.
> 


Unfortunately. It looks like it is systemd thing indeed, according to
this: 

https://unix.stackexchange.com/questions/254378/how-to-set-umask-for-the-entire-gnome-session#254923

and this

https://github.com/systemd/systemd/issues/6077

It also looks like it does not have workaround. Except to touch file
from terminal before editing it in gedit( if it is login shell, for
gnome-terminal edit > profile preferences > command > run command as
login shell ). Or even better launch gedit from that terminal, it will
have right umask settings. Or, make custom shortcut that will launch
terminal and gedit from it at same time, something like gnome-terminal
-e gedit. Sorry, but not much more help with systemd involved, I'm
afraid.



Re: How to change default umask in Stretch?

2017-08-07 Thread Dejan Jocic
On 07-08-17, Garrett R. wrote:
> No effect.
> 
> I added  "session optional pam_umask.so umask=0077" to the end of 
> /etc/pam.d/common-session. Then I confirmed /etc/login.defs has a umask 
> entry. Then I logged out and back in.
> 
> A new gedit document still reports permission rw-r--r--.
> 


Unfortunately. It looks like it is systemd thing indeed, according to
this: 

https://unix.stackexchange.com/questions/254378/how-to-set-umask-for-the-entire-gnome-session#254923

and this

https://github.com/systemd/systemd/issues/6077

It also looks like it does not have workaround. Except to touch file
from terminal before editing it in gedit( if it is login shell, for
gnome-terminal edit > profile preferences > command > run command as
login shell ). Or even better launch gedit from that terminal, it will
have right umask settings. Or, make custom shortcut that will launch
terminal and gedit from it at same time, something like gnome-terminal
-e gedit. Sorry, but not much more help with systemd involved, I'm
afraid.






Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
No effect.

I added  "session optional pam_umask.so umask=0077" to the end of 
/etc/pam.d/common-session. Then I confirmed /etc/login.defs has a umask entry. 
Then I logged out and back in.

A new gedit document still reports permission rw-r--r--.

- Original Message -
From: "Dejan Jocic" <jode...@gmail.com>
To: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 2:00:37 PM
Subject: Re: How to change default umask in Stretch?

On 07-08-17, Garrett R. wrote:
> I just tried this, adding "session optional pam_umask.so umask=0077" to the 
> end of the /etc/pam.d/login file.
> 
> No effect.
> 
> - Original Message -
> From: "Dejan Jocic" <jode...@gmail.com>
> To: debian-user@lists.debian.org
> Sent: Monday, August 7, 2017 1:11:02 PM
> Subject: Re: How to change default umask in Stretch?
> 
> On 07-08-17, Garrett R. wrote:
> > I apologize for the omissions.
> > 
> > I am booting debian to GDM. I login. I then open gedit (or libreoffice, 
> > etc). I type document. I save it.
> > 
> 
> 
> Have you tried to set in /etc/pam.d/login this:
> 
> session optional pam_umask.so umask=0077
> 
> Logout and login back after that?
> 

Now try to add it too to the /etc/pam.d/common-session and to set it up
in /etc/login.defs to your preferred value. Of course, logout/login
after all that.



Re: How to change default umask in Stretch?

2017-08-07 Thread Dejan Jocic
On 07-08-17, Garrett R. wrote:
> I just tried this, adding "session optional pam_umask.so umask=0077" to the 
> end of the /etc/pam.d/login file.
> 
> No effect.
> 
> - Original Message -
> From: "Dejan Jocic" <jode...@gmail.com>
> To: debian-user@lists.debian.org
> Sent: Monday, August 7, 2017 1:11:02 PM
> Subject: Re: How to change default umask in Stretch?
> 
> On 07-08-17, Garrett R. wrote:
> > I apologize for the omissions.
> > 
> > I am booting debian to GDM. I login. I then open gedit (or libreoffice, 
> > etc). I type document. I save it.
> > 
> 
> 
> Have you tried to set in /etc/pam.d/login this:
> 
> session optional pam_umask.so umask=0077
> 
> Logout and login back after that?
> 

Now try to add it too to the /etc/pam.d/common-session and to set it up
in /etc/login.defs to your preferred value. Of course, logout/login
after all that.









Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
I just tried this, adding "session optional pam_umask.so umask=0077" to the end 
of the /etc/pam.d/login file.

No effect.

- Original Message -
From: "Dejan Jocic" <jode...@gmail.com>
To: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 1:11:02 PM
Subject: Re: How to change default umask in Stretch?

On 07-08-17, Garrett R. wrote:
> I apologize for the omissions.
> 
> I am booting debian to GDM. I login. I then open gedit (or libreoffice, etc). 
> I type document. I save it.
> 


Have you tried to set in /etc/pam.d/login this:

session optional pam_umask.so umask=0077

Logout and login back after that?



Re: How to change default umask in Stretch?

2017-08-07 Thread Dejan Jocic
On 07-08-17, Garrett R. wrote:
> I apologize for the omissions.
> 
> I am booting debian to GDM. I login. I then open gedit (or libreoffice, etc). 
> I type document. I save it.
> 


Have you tried to set in /etc/pam.d/login this:

session optional pam_umask.so umask=0077

Logout and login back after that?





Re: How to change default umask in Stretch?

2017-08-07 Thread Greg Wooledge
On Mon, Aug 07, 2017 at 12:55:37PM -0400, Felix Miata wrote:
> Garrett R. composed on 2017-08-07 15:25 (UTC):
> 
> > Please advise on where "/etc/profile.local" is. I can find no such entry.
> 
> Like any .local file, it's an optional file. Any .local files that may exist 
> by
> default have uncommented content only if the /local/ admin creates any.

There is nothing in Debian's /etc/profile which reads such a file.

Debian's /etc/profile does, however, dot in all the files in
/etc/profile.d/.  No, wait.  Not all the files.  Just all the files
that end with a .sh suffix.  And you'd better not put spaces in the
filenames either, because there's a blatant bug right here:

  for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then
  . $i
fi
  done

I don't expect anything better; that would be foolish optimism in
violation of decades of historical precedent.



Re: How to change default umask in Stretch?

2017-08-07 Thread Dejan Jocic
On 07-08-17, Greg Wooledge wrote:
> On Mon, Aug 07, 2017 at 07:02:14PM +0200, Dejan Jocic wrote:
> > Ehh, disregard please. Just checked with gnome-terminal here, and it did
> > respect umask settings in .profile. But gedit did not.
> 
> If gnome-terminal is reading .profile, that means it must be running
> your shell as a login shell, which is a questionable practice.
> 
> Yet another strike against GNOME, if true.
> 

I run all my shells in terminal as login shells, because I prefer it
that way. If you do not like it, do not do it :P It has nothing to do
with Gnome.



Re: How to change default umask in Stretch?

2017-08-07 Thread Greg Wooledge
On Mon, Aug 07, 2017 at 07:02:14PM +0200, Dejan Jocic wrote:
> Ehh, disregard please. Just checked with gnome-terminal here, and it did
> respect umask settings in .profile. But gedit did not.

If gnome-terminal is reading .profile, that means it must be running
your shell as a login shell, which is a questionable practice.

Yet another strike against GNOME, if true.



Re: How to change default umask in Stretch?

2017-08-07 Thread Greg Wooledge
On Mon, Aug 07, 2017 at 06:54:13PM +0200, Dejan Jocic wrote:
> Depends on terminal. If you use xterm under Gnome, it will respect umask
> settings, wherever those are, global or local in .profile or .bashrc.
> But gnome-terminal does not respect those settings. Guess that you
> should file bug against gnome.

Parts of this paragraph are not correct.

Putting a umask command in .bashrc would cause it to be run every time
you run a non-login bash shell, for example by opening an xterm, or a
new tab inside a gnome-terminal.  That particular instance of bash would
have the umask that you expect, because it's overriding the terminal's
umask due to the command it reads in .bashrc.

But the OP was trying to get gedit's umask to be different, and I'm
guessing (s)he's running gedit directly from GNOME, e.g. from some
kind of drop-down menu or hotkey, not by typing the gedit command in
a terminal.  Thus, gedit only inherits the umask from the window
manager (or whatever its parent is), not from any instance of bash.

To set umask of the window manager (or whatever), the instructions I gave
previously should work.  They do for *my* window manager.  But GNOME
may unilaterally decide to *change* the user's umask to whatever GNOME
decides is a correct value.  We've seen other unsolvable questions from
GNOME users here, e.g. one person was trying to set LC_* locale variables,
and GNOME just blew them away.  I don't believe we ever found an answer
for how to make it stop doing that.

Anyway, GNOME is a disaster, with the software assuming that it knows
better than you what you want, and with (apparently) no way to tell
it how to act differently.

Fortunately we have lots of other choices.



Re: How to change default umask in Stretch?

2017-08-07 Thread Dejan Jocic
On 07-08-17, Dejan Jocic wrote:
> On 07-08-17, Garrett R. wrote:
> > Terminal confirms my umask is 022. That is, my entries at login.defs, 
> > xsessionrc, etc are not working.
> > 
> > Thank you for your assistance, Greg. Before asking here, my research 
> > indicated gnome is the problem and it is because of systemd that there is a 
> > problem. I assumed because gnome is default on debian, you might have some 
> > insight. 
> > 
> > Thank you for your efforts, much appreciated.
> > 
> 
> Depends on terminal. If you use xterm under Gnome, it will respect umask
> settings, wherever those are, global or local in .profile or .bashrc.
> But gnome-terminal does not respect those settings. Guess that you
> should file bug against gnome.
> 
> 
> 


Ehh, disregard please. Just checked with gnome-terminal here, and it did
respect umask settings in .profile. But gedit did not.



Re: How to change default umask in Stretch?

2017-08-07 Thread Felix Miata
Garrett R. composed on 2017-08-07 15:25 (UTC):

> Please advise on where "/etc/profile.local" is. I can find no such entry.

Like any .local file, it's an optional file. Any .local files that may exist by
default have uncommented content only if the /local/ admin creates any.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/



Re: How to change default umask in Stretch?

2017-08-07 Thread Dejan Jocic
On 07-08-17, Garrett R. wrote:
> Terminal confirms my umask is 022. That is, my entries at login.defs, 
> xsessionrc, etc are not working.
> 
> Thank you for your assistance, Greg. Before asking here, my research 
> indicated gnome is the problem and it is because of systemd that there is a 
> problem. I assumed because gnome is default on debian, you might have some 
> insight. 
> 
> Thank you for your efforts, much appreciated.
> 

Depends on terminal. If you use xterm under Gnome, it will respect umask
settings, wherever those are, global or local in .profile or .bashrc.
But gnome-terminal does not respect those settings. Guess that you
should file bug against gnome.





Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
Terminal confirms my umask is 022. That is, my entries at login.defs, 
xsessionrc, etc are not working.

Thank you for your assistance, Greg. Before asking here, my research indicated 
gnome is the problem and it is because of systemd that there is a problem. I 
assumed because gnome is default on debian, you might have some insight. 

Thank you for your efforts, much appreciated.

- Original Message -
From: "Greg Wooledge" <wool...@eeg.ccf.org>
To: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 12:14:43 PM
Subject: Re: How to change default umask in Stretch?

On Mon, Aug 07, 2017 at 04:00:17PM +, Garrett R. wrote:
> I have created a file named ".xsessionrc" and it is in my home folder 
> (~/.xsessionrc). Within this file I wrote this: umask 077.
> 
> No change is evident. I first tried a relogin. No effect. I then rebooted. 
> Also no effect. Creating documents still results in rw-r--r--.

Easiest way to verify it would be to open a terminal and run "umask".

> (I am logging in with gnome display manager and opening documents from the 
> gnome-shell interface, not from a terminal).

In that case, it sounds like GNOME is overriding your umask.  You may
have to ask a GNOME support list how to work around this.  The first
Google result I found suggests adding it in ~/.gnomerc instead (in
addition to a crapload of obviously, blatantly *wrong* answers, as
usual).  I don't know whether .gnomerc will work, but you can try.

Rebooting would not matter.  The ~/.xsessionrc file is read by the
Debian X session when you login.  The problem is, anything you set there
can be changed later, e.g. by GNOME.

I tested it just now on my system, creating a ~/.xsessionrc file
containing "umask 002", and then running "startx -- :1" from tty2.
This gave me a(nother) X session, in which the umask was set to 002 as
expected (confirmed by running umask in a terminal).  But I don't
use GNOME.  I just use a window manager, fvwm.



Re: How to change default umask in Stretch?

2017-08-07 Thread Greg Wooledge
On Mon, Aug 07, 2017 at 04:00:17PM +, Garrett R. wrote:
> I have created a file named ".xsessionrc" and it is in my home folder 
> (~/.xsessionrc). Within this file I wrote this: umask 077.
> 
> No change is evident. I first tried a relogin. No effect. I then rebooted. 
> Also no effect. Creating documents still results in rw-r--r--.

Easiest way to verify it would be to open a terminal and run "umask".

> (I am logging in with gnome display manager and opening documents from the 
> gnome-shell interface, not from a terminal).

In that case, it sounds like GNOME is overriding your umask.  You may
have to ask a GNOME support list how to work around this.  The first
Google result I found suggests adding it in ~/.gnomerc instead (in
addition to a crapload of obviously, blatantly *wrong* answers, as
usual).  I don't know whether .gnomerc will work, but you can try.

Rebooting would not matter.  The ~/.xsessionrc file is read by the
Debian X session when you login.  The problem is, anything you set there
can be changed later, e.g. by GNOME.

I tested it just now on my system, creating a ~/.xsessionrc file
containing "umask 002", and then running "startx -- :1" from tty2.
This gave me a(nother) X session, in which the umask was set to 002 as
expected (confirmed by running umask in a terminal).  But I don't
use GNOME.  I just use a window manager, fvwm.



Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
I have created a file named ".xsessionrc" and it is in my home folder 
(~/.xsessionrc). Within this file I wrote this: umask 077.

No change is evident. I first tried a relogin. No effect. I then rebooted. Also 
no effect. Creating documents still results in rw-r--r--.

(I am logging in with gnome display manager and opening documents from the 
gnome-shell interface, not from a terminal).


Is there a specific entry that I should have made in the ~/.xsessionrc file? 
Should I "undo" the entries I made at /etc/login.defs and/or ~/.profile? Those 
are still set to 077 as I mentioned previously. So I have /etc/login.defs, 
~/.profile and ~/.xsessionrc all with entry "umask 077". But the result is 
rw-r--r--.

- Original Message -
From: "Greg Wooledge" <wool...@eeg.ccf.org>
To: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 11:37:24 AM
Subject: Re: How to change default umask in Stretch?

On Mon, Aug 07, 2017 at 03:25:27PM +, Garrett R. wrote:
> I have set /etc/login.defs to a umask of 077. Also, I commented out the 
> USERGROUPS_ENAB entry.
> 
> When I create gedit documents (for example), I am getting rw-r--r--. This 
> does not reflect umask 077.
> 
> I then went to ~/.profile and set umask there. But this had no effect on 
> anything.

OK, you're not going to give us any details without tooth-pulling.
That sucks.  I will have to rely upon guesswork.

You used the word "login" and the word "gedit".  This tells me that you
may be concentrating, currently, one of the two following scenarios:

1) You login locally through a display manager into an X session.

2) You login locally on the Linux console and use startx to launch
   an X session.

Now, we can probably rule out #2, because you claim that modifications
to ~/.profile did not work.  There are various situations where you
*could* still be using console login + startx and have your changes in
~/.profile not take effect, but the simplest answer suggests you are
not doing that.

So, you're probably logging in through a display manager.

If you want to configure the X session that you get when logging in
through a Debian display manager, use the file ~/.xsessionrc
instead of ~/.profile.

See <https://wiki.debian.org/Xsession>.

Yes, Virginia, ~/.xsessionrc does not exist by default.  You would have
to create it.  (These days, users have to be *told* this for some reason.
They whine and moan if you don't reassure them that yes, it's OK that
a file doesn't exist and that they should create it.  Sad but true.
And this user top-posted, so I'm inclined to suspect he/she falls into
that group.)

No, I am not talking about ~/.xsession.  ~/.xsessionrc is a totally
different file.



Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
I apologize for the omissions.

I am booting debian to GDM. I login. I then open gedit (or libreoffice, etc). I 
type document. I save it.

- Original Message -
From: "Greg Wooledge" <wool...@eeg.ccf.org>
To: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 11:37:24 AM
Subject: Re: How to change default umask in Stretch?

On Mon, Aug 07, 2017 at 03:25:27PM +, Garrett R. wrote:
> I have set /etc/login.defs to a umask of 077. Also, I commented out the 
> USERGROUPS_ENAB entry.
> 
> When I create gedit documents (for example), I am getting rw-r--r--. This 
> does not reflect umask 077.
> 
> I then went to ~/.profile and set umask there. But this had no effect on 
> anything.

OK, you're not going to give us any details without tooth-pulling.
That sucks.  I will have to rely upon guesswork.

You used the word "login" and the word "gedit".  This tells me that you
may be concentrating, currently, one of the two following scenarios:

1) You login locally through a display manager into an X session.

2) You login locally on the Linux console and use startx to launch
   an X session.

Now, we can probably rule out #2, because you claim that modifications
to ~/.profile did not work.  There are various situations where you
*could* still be using console login + startx and have your changes in
~/.profile not take effect, but the simplest answer suggests you are
not doing that.

So, you're probably logging in through a display manager.

If you want to configure the X session that you get when logging in
through a Debian display manager, use the file ~/.xsessionrc
instead of ~/.profile.

See <https://wiki.debian.org/Xsession>.

Yes, Virginia, ~/.xsessionrc does not exist by default.  You would have
to create it.  (These days, users have to be *told* this for some reason.
They whine and moan if you don't reassure them that yes, it's OK that
a file doesn't exist and that they should create it.  Sad but true.
And this user top-posted, so I'm inclined to suspect he/she falls into
that group.)

No, I am not talking about ~/.xsession.  ~/.xsessionrc is a totally
different file.



Re: How to change default umask in Stretch?

2017-08-07 Thread Greg Wooledge
On Mon, Aug 07, 2017 at 03:25:27PM +, Garrett R. wrote:
> I have set /etc/login.defs to a umask of 077. Also, I commented out the 
> USERGROUPS_ENAB entry.
> 
> When I create gedit documents (for example), I am getting rw-r--r--. This 
> does not reflect umask 077.
> 
> I then went to ~/.profile and set umask there. But this had no effect on 
> anything.

OK, you're not going to give us any details without tooth-pulling.
That sucks.  I will have to rely upon guesswork.

You used the word "login" and the word "gedit".  This tells me that you
may be concentrating, currently, one of the two following scenarios:

1) You login locally through a display manager into an X session.

2) You login locally on the Linux console and use startx to launch
   an X session.

Now, we can probably rule out #2, because you claim that modifications
to ~/.profile did not work.  There are various situations where you
*could* still be using console login + startx and have your changes in
~/.profile not take effect, but the simplest answer suggests you are
not doing that.

So, you're probably logging in through a display manager.

If you want to configure the X session that you get when logging in
through a Debian display manager, use the file ~/.xsessionrc
instead of ~/.profile.

See .

Yes, Virginia, ~/.xsessionrc does not exist by default.  You would have
to create it.  (These days, users have to be *told* this for some reason.
They whine and moan if you don't reassure them that yes, it's OK that
a file doesn't exist and that they should create it.  Sad but true.
And this user top-posted, so I'm inclined to suspect he/she falls into
that group.)

No, I am not talking about ~/.xsession.  ~/.xsessionrc is a totally
different file.



Re: How to change default umask in Stretch?

2017-08-07 Thread Garrett R.
I have set /etc/login.defs to a umask of 077. Also, I commented out the 
USERGROUPS_ENAB entry.

When I create gedit documents (for example), I am getting rw-r--r--. This does 
not reflect umask 077.

I then went to ~/.profile and set umask there. But this had no effect on 
anything.

Please advise on where "/etc/profile.local" is. I can find no such entry.

> Is your question based on the documentation contained within /etc/profile and
/etc/login.defs? I don't think "systemd" changed anything, while pam may have. I
still reconfigure globally using /etc/profile.local.

- Original Message -
From: "Felix Miata" <mrma...@earthlink.net>
To: debian-user@lists.debian.org
Sent: Monday, August 7, 2017 12:50:35 AM
Subject: Re: How to change default umask in Stretch?

Garrett R. composed on 2017-08-06 20:50 (UTC):

> The "old" methods for changing the default umask no longer work in Debian
> Stretch.

> It appears systemd now manages umask. Can someone please describe how I can
> change the default umask setting in Stretch?
 Is your question based on the documentation contained within /etc/profile and
/etc/login.defs? I don't think "systemd" changed anything, while pam may have. I
still reconfigure globally using /etc/profile.local.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/



Re: How to change default umask in Stretch?

2017-08-07 Thread Greg Wooledge
On Sun, Aug 06, 2017 at 08:50:05PM +, Garrett R. wrote:
> It appears systemd now manages umask. Can someone please describe how I can 
> change the default umask setting in Stretch?

The umask *of what*?  Of login shells?  Of files uploaded via ftpd?
Of files uploaded via sshd/builtin sftp?  Of desktop environment sessions
started from a display manager?  Of some random cron job?



Re: How to change default umask in Stretch?

2017-08-06 Thread Felix Miata
Garrett R. composed on 2017-08-06 20:50 (UTC):

> The "old" methods for changing the default umask no longer work in Debian
> Stretch.

> It appears systemd now manages umask. Can someone please describe how I can
> change the default umask setting in Stretch?
 Is your question based on the documentation contained within /etc/profile and
/etc/login.defs? I don't think "systemd" changed anything, while pam may have. I
still reconfigure globally using /etc/profile.local.
-- 
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/



Re: How to change default umask in Stretch?

2017-08-06 Thread Dennis Creedan
I think the default umask is defined in /etc/profile.

On Sun, Aug 6, 2017 at 2:50 PM, Garrett R.  wrote:
> The "old" methods for changing the default umask no longer work in Debian 
> Stretch.
>
> It appears systemd now manages umask. Can someone please describe how I can 
> change the default umask setting in Stretch?
>



How to change default umask in Stretch?

2017-08-06 Thread Garrett R.
The "old" methods for changing the default umask no longer work in Debian 
Stretch.

It appears systemd now manages umask. Can someone please describe how I can 
change the default umask setting in Stretch?