tech-userlevel archive

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

Re: Proposal: remove usr.bin/mkstr

Am 17.04.2022 um 13:07 schrieb Robert Elz:
And still no-one has provided a single good reason why it should be
removed, nothing better than not seeing a reason to keep it, which is
an entirely different thing.   If someone can explain what harm it is
doing, I would probably stop objecting. says:
> NetBSD was originally released in 1993. Over time, its code
> has found its way into many surprising environments, on the
> basis of a long history of quality, cleanliness, and stability.
> The NetBSD code was originally derived from 4.4BSD Lite2 from
> the University of California, Berkeley.

From the features in the above list, mkstr violates the "quality" since
it breaks lots of valid C code:

Code that contains 'perror("string")' or 'yyerror("string")' is
transformed into 'perror(123)' or 'yyerror(123)', which is simply wrong.

In \x escapes in string literals, the backslash is silently removed.

In octal escapes in string literals, each octal escape that starts with
\0 is interpreted as the actual \0, so \007 is "\0""07", and \033
becomes "\0""33".  Of course, since the string ends at the first \0, the
"33" does not get written to the message file.

In octal escapes in string literals that start with a digit other than
'0', mkstr messes up the first digit by shifting it 10 places to the
left, which is obviously wrong.  It should rather be 6 places.

In concatenated string literals, only the first string literal is
retained, the others are thrown away silently.

Long string literals produce buffer overflows.


Given that mkstr is a simple program of just 320 lines of text, I hope
the above list is enough to convince you that its quality is below any
acceptable limit.

Distributing such crappy programs hurts the reputation of NetBSD
delivering quality software, therefore it should be removed.


Home | Main Index | Thread Index | Old Index