News for hackers. Stuff that matters.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by realharo on Thursday November 05, 2026 @12:16PM (#50381667)
>because crypt in musl started returning "*" in some cases some years ago

In Rust, the type of the return value would be a `Result<T, E>`, which means the chain of events that led to this would never have started in the first place.

Re:Alpine Linux Security advisory: OpenSSH-server password a... by my-huge-pony on Thursday November 05, 2026 @12:18PM (#50381696)
In C the return value would be NULL, except it was changed by musl at some point.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by realharo on Thursday November 05, 2026 @12:28PM (#50381826)
The type of the value in C is `char*`.

That's what led some people to write code where it crashes without checks. Which is still their mistake. But if the type was something that can't be implicitly used like an always-present value, that would have prevented the situation, even with those same people.

Re:Alpine Linux Security advisory: OpenSSH-server password a... by uecker on Thursday November 05, 2026 @02:47PM (#50383542)
A pointer is a type where a null pointer can't be used as a regular value but leads to a trap when dereferenced.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by realharo on Friday November 06, 2026 @02:33PM (#50397216)
By "can't be used as a regular value", I meant that it would be a compile-time error.
Re:Alpine Linux Security advisory: OpenSSH-server password a... by uecker on Friday November 06, 2026 @05:22PM (#50399300)
I see. For safety a run-time check is enough though.

But it turns out one can have a compile-time error forthis in C as well: https://godbolt.org/z/8E9z66cfs

Re:Alpine Linux Security advisory: OpenSSH-server password a... by atomicUpdate on Thursday November 05, 2026 @02:04PM (#50383014)
You mean could be a `Result<T, E>`. There’s nothing in Rust that forces that.