[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [minor] umask 400 causes here-{doc,string} failure
From: |
Greg Wooledge |
Subject: |
Re: [minor] umask 400 causes here-{doc,string} failure |
Date: |
Mon, 29 Oct 2018 09:53:04 -0400 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Sun, Oct 28, 2018 at 09:30:00PM -0400, Chet Ramey wrote:
> That doesn't work for the same reason as discussed in
> http://lists.gnu.org/archive/html/bug-bash/2018-03/msg00074.html.
> It's unlikely that someone will set his umask to 400 and expect no ill
> effects, but I suppose it's better not to fail in the face of that kind
> of behavior.
I still maintain that the "umask 400" is most likely a user error.
The user probably wanted a umask that would cause all of the files to
have 0400 permissions. Such a umask would be 0377, not 0400.
A umask that denies read permission to the owner of the file but leaves
the file world writable is simply not rational.
Bash's behavior seems acceptable to me:
wooledg:~$ bash -c 'umask 0777; cat <<< hello'
bash: cannot create temp file for here-document: Permission denied
wooledg:~$ bash-5.0-beta -c 'umask 0777; cat <<< hello'
bash-5.0-beta: cannot create temp file for here-document: Permission denied
But if you want to follow ksh's lead, I would also find that acceptable:
wooledg:~$ ksh -c 'umask 0777; cat <<< hello'
hello