On 06/13/2014 08:12 AM, Ertugrul Söylemez wrote:
Vladimír Čunát <[email protected]> wrote:So far there's IMHO been no really good solution proposal. And probably none is currently providing binaries to use.The path-rewriting proposal is a very bad idea and will cause a lot of breakage. For many/enough applications rewriting will not work at all, because they might encode paths in data structures or be using a non-UTF8 multi-byte encoding. [...] In other words: Do not rewrite paths! If your proposal requires violently manipulating binaries, it is most likely a bad idea.
Well, nix does use the "hash rewriting" technique in some cases. I don't remember exactly; referenced e.g. in https://github.com/NixOS/nix/issues/122
I don't know about encountering any such trouble.
One simple and safe way to do this would involve using private mounts with chrooting: Create a private bind-mount of "/" somewhere, then bind-mount the Nix store at "/nix/store". Run the application within a chroot in that directory. To the application the Nix store will appear to be mounted at "/nix/store".
Unfortunately, missing the privileges is almost the only reason not to use /nix/store path.
Another way would be to hook the path handling procedures of the libc. Rewrite "/nix/store" to whatever is in the NIX_STORE variable. This would be a lot of hard work, but would work much more reliably than rewriting paths in binaries, and it would work without help from root.
Hmm, globally LD_PRELOADing a file that would do this might be a viable option for those people. No new binaries would be necessary, only fixing this in *all* path-handling glibc functions is likely to be tricky.
Vlada
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
