tech-toolchain archive

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

Re: TOCTOU bug in make(1)



Am 06.10.2022 um 23:46 schrieb Valery Ushakov:
It did have a comment, but it was removed in revision 1.548.  It also,
unnecessarily, IMHO, decided to change the return type to a more
"modern" bool thus further obscuring the fact that the function was a
simple wrapper around unlink(2).

https://github.com/NetBSD/src/commit/802525406eefb0d4e9eb06aad7b5b03bfd55609c

The comment said:

/* eunlink -- Remove a file carefully, avoiding directories. */

The part "carefully" was too unspecific to be useful. From reading it, I
didn't know that it referred to some operating systems allowing to
unlink a directory, and I wouldn't expect any other reader to know this
detail. Those readers who know this detail don't need the comment, and
those who don't know it don't get any clues from the comment.

The part "avoiding directories" was obvious from the few lines of code,
so I considered it redundant.

That's why I removed the whole comment.

Roland



Home | Main Index | Thread Index | Old Index