*sshole, or when are we going to get rid of C? sunshowers.io · 25 points · 7 com...
HN Best 200 @best
*sshole, or when are we going to get rid of C? sunshowers.io · 25 points · 7 comments · HN thread
TL;DR The author argues that a recent vulnerability is a C-specific engineering-culture problem: musl's crypt() returns the sentinel "*" for over-long passwords, which is also the locked-account marker on Unix, so on musl systems without PAM (such as the official Alpine AWS image) an unauthenticated user can get a shell. The post contends that C's lack of result types drives in-band signaling that Rust norms would not allow, and it criticizes distro maintainers who resist Rust and the idea that LLM agents make language choice irrelevant.
- Unix has treated a password hash of "*" as a locked account for decades.
- Since 2012 musl libc's crypt returns "*" for passwords too long to hash, deviating from POSIX, which requires a null pointer and errno.
- sshd hashes login attempts for locked accounts to avoid timing leaks, so the two conditions combine into an unauthenticated login path on musl systems without PAM.
- The author says this is not memory safety; the difference is that C's type system cannot force callers to check errors, while Rust's error variants compel handling.
- The post argues that agents do not remove the need for good language norms, since agents pattern-match on existing code and community conventions matter.
- The author criticizes Linux distro maintainers who object to Rust dependencies.
Discussion The thread is short and split. One commenter jokes about compile times and another dismisses the vulnerability as routine and blames packaging hygiene. A few commenters push back on the post's framing: one argues the bug reflects poor design rather than C itself, and the author replies tersely. A clarifying reply explains the post's claim about C conventions encouraging in-band signaling. The mood is skeptical and somewhat combative, with the language debate overshadowing the security details.
- Bug is poor design, not a C problem (some): Commenters argue the flaw comes from how the sentinel was chosen and that blaming the language is unfair, comparing it to blaming a tracksuit for bad driving.
- C culture encourages in-band signaling (some): A reply defends the post by saying C conventions make sentinel values common and unremarkable, and Rust conventions would discourage this pattern.
- Rust compile times are a real cost (a few): One commenter states a dislike of Rust compile times, reflecting the cost trade-off the post itself acknowledges.
- Simply upgrade packages and pay attention (a few): A commenter dismisses the news as routine and says the fix is applying updates.
- Same pattern exists in Python (a few): A commenter notes that Python code could make the same mistake by returning a sentinel such as None or a special string instead of raising.