|
|
Subscribe / Log in / New account

More robust oxidizr behavior?

More robust oxidizr behavior?

Posted Mar 19, 2025 9:12 UTC (Wed) by taladar (subscriber, #68407)
In reply to: More robust oxidizr behavior? by PeeWee
Parent article: Oxidizing Ubuntu: adopting Rust utilities by default

At the very least env itself needs to be guaranteed to be in a fixed place for env use to make any sense at all.


to post comments

More robust oxidizr behavior?

Posted Mar 19, 2025 10:54 UTC (Wed) by PeeWee (guest, #175777) [Link] (1 responses)

Yes, as I have eluded to elsewhere in this thread. But that would be the only fixed and absolute path. BTW, why does $PATH exist if people insist on calling by absolute paths? Unless there is a very good reason, one should just not do that.

More robust oxidizr behavior?

Posted Mar 21, 2025 2:47 UTC (Fri) by raven667 (subscriber, #5198) [Link]

PATH exists for the interactive user convenience, but robust scripts don't operate in the same environment and it's reasonable to either sanitize $PATH to a known quantity or skip relying on it at all and hardcode all paths to system binaries that rarely change on the platform/version you support. Scripts have to take a whole bunch of defensive measures like pervasive quoting, using quoted arrays for arguments, explicit exit checking/set -e and other techniques that aren't at all like someone using a shell interactively. The two use cases regularly conflict in their wants and needs, which is why stuff gets reimplemented in perl or Python sometimes and things like suid shell scripts are impossible.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds