Hacker News
points by odo1242 2 days ago | 0 comments
Returning a string on error honestly is defensible (especially in a language like C where the type system doesn’t have exceptions or result types), the question is why the string was “*” instead of like “crypt ERROR: input password cannot be longer than 256 characters” lol
[–] mmoll 2 days ago
No. Musl claims (claimed?) to be strictly POSIX compliant, and POSIX requires crypt to return NULL on errors.
[–] tredre3 2 days ago
"*" is what's been historically used to represent an invalid/no value in passwd/shadow, so it makes some sense.

Of course given the chance that one might do a direct string comparison between crypt's return and the passwd/shadow file's hash field it was still a not well thought out choice.

[–] gf000 2 days ago
No, it's absolutely not defensible.
[–] dboreham 2 days ago
Precisely.
Hacker News