4 ms·
What was the solution he was looking for?
by mandarax8 2y ago
What was the solution he was looking for?
- Filligree 2y agoThere’s a couple. One would be to run a Python interpreter and fix it with that.
- zbentley 2y agoHow would you launch the python interpreter if its binary is missing execute permissions?
- t-3 2y agoIn the unlikely case that you actually have a static sbin and not just a symlink you could hack together a one-liner using file or objdump to check headers and set correct perms... but considering that everything in the dir should be either an executable or a directory, chmod a+x would work just as well. If /usr/bin isn't a symlink to /bin or vice-versa, then you should have tools there to do the same thing. If you somehow still have a working C compiler (or access to another language that can do syscalls or has C bindings), it's pretty easy to write a wrapper for the syscall. If there's an rsync daemon, nfs share, etc. running, you can copy over a static busybox and fix the system that way. If you're allowed to take the system down, it's really easy - just boot up a live image and change the permissions.
- Filligree 2y ago> If you're allowed to take the system down, it's really easy - just boot up a live image and change the permissions. Having held a couple interviews like this, if you suggest taking the system down, I'll tell you that would work -- now tell me another way to do it. It's still a plus that you suggested it, even if it isn't enough of an answer on its own.
- t-3 2y agoI thought of another thing: many desktop systems have automount daemons, so USB could also be used to transfer over a busybox in that case.
- deleted 2y ago[deleted]