5 ms·
If they don’t link libc statically it can become a problem if the system-installed libc is corrupt or incompatible. My Arch install broke once and I wasn’t able
by sebazzz 3y ago
If they don’t link libc statically it can become a problem if the system-installed libc is corrupt or incompatible. My Arch install broke once and I wasn’t able to run pacman to correct it, because the libc installed was not compatible with pacman. If sudo wouldn’t run, I would not even have a chance to repair the install without booting to live cd.
- Quekid5 3y agoI'd invest $10 into a rescue USB stick regardless. I like putting Ventoy on it and having a large number of different distribution ISOs on there, just in case.
- Arnavion 3y agoWhat distros are there that normally dynamically link everything but statically link sudo? OpenSUSE, Debian and Ubuntu (the distros I have on hand) do not, at least.
- paholg 3y agoI just checked on NixOs, and ldd reports sudo is not dynamic.
- justinsaccount 3y agoDid you check the real sudo binary, or the setuid wrapper? On my system sudo is `/run/wrappers/bin/sudo` but that is a setuid wrapper for `/nix/store/z008bzqrl2zc848gjhh04012jhxpl72q-sudo-1.9.15p5/bin/sudo` which is dynamically linked.
- paholg 3y agoAh, I guess I just checked the wrapper. That's what I get for doing it on my phone over ssh. I would have probably looked deeper with a real keyboard.
- dralley 3y agoIf the system-provided libc is corrupt, isn't sudo the least of your concern? What else is going to work?
- jokethrowaway 3y agoFunnily enough something similar happened to me after doing a partial update. Doing a partial update are not supported in arch linux for this very reason. sudo broke as well as many others command. ssh worked for a bit and then segfaulted. I edited my PATH to have a healthy version of libc but things kept breaking in different ways (version mismatches) In the end I had to use a live usb drive as I couldn't write to /usr/lib
- rnijveld 3y agoThis only works on Linux of course since the Linux kernel and libc are not tightly coupled, on any other OS dynamically linking against libc is a necessity. Also, I've never seen anyone statically linking against glibc? Is that even something people do? I'd consider your system provided libc being broken is a similar situation to an unbootable kernel: you just need a rescue stick/partition to fix it, or reinstall your OS.