Re: [PATCH] add/remove-shell: prevent world writable /etc/shells

2017-05-26 Thread Denys Vlasenko
On Wed, May 10, 2017 at 6:40 PM, Natanael Copa wrote: > add-shell will not preserve the current permissions, and if umask is 0 > it will create the /etc/shells world writable. To reproduce: > > umask 0; add-shell /bin/bash; ls -l /etc/shells > > As a workaround we add the

[PATCH] add/remove-shell: prevent world writable /etc/shells

2017-05-10 Thread Natanael Copa
add-shell will not preserve the current permissions, and if umask is 0 it will create the /etc/shells world writable. To reproduce: umask 0; add-shell /bin/bash; ls -l /etc/shells As a workaround we add the current st_mode with xopen3, which at least will prevent /etc/shells to get more