Skip to main content

CodeSOD: Extremely One Line

3 weeks 6 days ago

Autoformatting your code is a standard thing to do these days. And in those days past, if we're being honest. There's no excuse to not use some kind of autoformatter. Whether you configure your editor to do it or are a weirdo like me who runs a formatter from the CLI as a build step, you've got an easy way to format your code so it looks neat and readable. And some IDEs, like Visual Studio, are pretty insistent about doing this for you. Which makes today's code sample a bit more perplexing. This comes from an ancient ASP .Net application that Austin has the misfortune to work with:

protected void Page_PreInit(object sender, EventArgs e){if (Request.ServerVariables["http_user_agent"].IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) != -1)Page.ClientTarget = "uplevel";} protected void Page_Load(object sender, EventArgs e) { Logic(); }

Which function is Logic() called from? The fact that I'm asking probably is enough to get you to scroll over. The entire Page_PreInit function is on a single line, followed by the declaration of the Page_Load function. A confusing and annoying choice. The real bonus is that if the browser has "Safari" in its user agent, we set a field to a mysterious "uplevel" value. A mix of user agent sniffing, strings as enums/flags, and wonderfully unclear names.

And yes, this particular pattern appears in more than one page in Austin's application. Someone thought this was not just a good idea, but good enough to do over and over again.

[Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.
Remy Porter

Ubuntu's 'Rust-ification' Hits New Milestone: Coreutils Migration is Complete

3 weeks 6 days ago
"Ubuntu has managed to do away with GNU Core Utilities in its default stack," reports the blog It's FOSS. The last three utilities — cp, mv and rm — have been moved to versions from the uutils project (which reimplements utilities in Rust). Everything else, from ls and cat to chmod and du, made that jump in earlier releases... Canonical started "oxidizing" Ubuntu last year, and Ubuntu 25.10 became the first release to ship [ the uutils project's] coreutils as the default. That release also made sudo-rs the default privilege tool, replacing a command that had been in place for decades. 26.04 was the release where the plan did slow down quite a bit, as Canonical kept cp, mv, and rm on their GNU versions due to a bunch of TOCTOU issues that were blocking the full implementation. These were caught during an audit, when Canonical commissioned Zellic for two rounds between December 2025 and March 2026, focusing on the most security-sensitive utilities first. Across both rounds, Zellic raised 113 issues, and 44 of them were assigned CVEs. Canonical says the vast majority have been resolved. Getting here has had its ups and downs, and the last stretch was not clean. In July, uutils cp went back into the archive and came straight out again after it broke live image builds. The fix was quick; as the developers marked it "Critical," the fix went upstream, and the migration landed in time for 26.10. When typing commands, nothing changes for you on the surface. uutils coreutils is designed to be a drop-in replacement for essential GNU tools, and the project treats any divergence from GNU as a bug, further pointing out that some options may still be missing or behave differently. So if you prefer staying on the GNU version, you have the option to install the coreutils-from-gnu package that houses all the required components.

Read more of this story at Slashdot.

EditorDavid