4 ms·
How can this work in sandbox distributions? For example in a snap or flatpak package where a binary is in a read only mode and with limited permissions?
by 3v1n0 5y ago
How can this work in sandbox distributions?
For example in a snap or flatpak package where a binary is in a read only mode and with limited permissions?
- lifthrasiir 5y agoThere is a compile option named APE_NO_MODIFY_SELF which writes and launches a copy of itself into the tmpdir instead of self-modifying (with a huge caveat).
- nonameiguess 5y agoHer comment here acknowledges this, but this will cause problems when /tmp is mounted noexec, which is fairly common for servers: https://github.com/jart/cosmopolitan/blob/da8a08fd58324a87f6ac673b7774512e861fe477/ape/ape.S#L549-L561 https://github.com/jart/cosmopolitan/blob/da8a08fd58324a87f6... I suppose this level of portability is more a feature if you're shipping to PCs anyway, though. If you're deploying to servers, you know the arch and OS ahead of time and there is no obvious downside I can think of to just targeting it directly.
- mikepurvis 5y agoWell, or if you could do it during commissioning, like have a local Ansible step that pre-flavours the executable for the target, then pushes it over.