Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: [minor] umask 400 causes here-{doc,string} failure Date: Mon, 29 Oct 2018 09:53:04 -0400 Lines: 26 Approved: bug-bash@gnu.org Message-ID: References: <20180311151742.GB6450@chaz.gmail.com> <46a9261c-f21b-14c8-93fd-db7d7fdfdf78@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1540821224 24016 208.118.235.17 (29 Oct 2018 13:53:44 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org Mail-Followup-To: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <46a9261c-f21b-14c8-93fd-db7d7fdfdf78@case.edu> User-Agent: NeoMutt/20170113 (1.7.2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14744 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