[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#20241: Timezones should depend on debian-utils



Miquel van Smoorenburg <miquels@cistron.nl> writes:

> According to Topi Miettinen:

[snip]

> > I thought so too until Richard Braakman enlightened me: bash checks if the
> > file is regular file, if not, opens it without O_EXCL. Which is worse,
> > zapping /etc/passwd or /dev/hda? :-(
> 
> You're kidding! I should ofcourse have investigated bash, but I once
> wrote a Posix shell myself (years ago) [that's why I know about much of the
> obscure Posix stuff] and I did use O_EXCL.

All the shells I tried except ash seem to do this.  bash and ksh have
race conditions (statting the file before opening it) so you could
clobber a regular file anyway, although it might be a bit unlikely to
hit two races successfully.  zsh tries with O_EXCL, then tries again
without it if that fails and fstats the fd.

ash doesn't know about -C.

It seems to me that if all these shells behave the same, they must be
doing it on purpose.  I wouldn't be surprised if it *is* so they can
write to /dev/null when -C is set.

-- 
	 Carey Evans  http://home.clear.net.nz/pages/c.evans/

	  GNU GPL: "The Source will be with you... always."


--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: