[Nix-dev] RealVNC package -- hardcoded paths in binaries

Bjørn Forsman bjorn.forsman at gmail.com
Mon Jul 29 20:05:48 CEST 2013


On 29 July 2013 19:33, Michael Ashton <data at gtf.org> wrote:
> Hello all,
>
> I'm working on an expression for RealVNC (on GitHub here [1]). This is a
> binary-only, closed-source commercial VNC distribution. And, of course, it
> has lots of hardcoded paths.
>
> So far I can get the binaries to execute, thanks to patchelf, but the server
> still fails because it can't find a number of things at various places in
> the filesystem, like /etc/vnc, /usr/X11R6/lib, /usr/share/vnc, and so forth.
>
> I'm wondering what would be the right way to deal with this. At the moment I
> can only think of two possibilities: patching the binaries somehow, or
> running everything in a chroot. The former seems a little too crazy and/or
> impossible, so I'm thinking of trying to run everything in chroot, although
> I think that will also not be at all easy. But maybe there's a better or
> more correct way?
>
> This seems somewhat similar to the situation with Steam discussed on the
> wiki. But on that page it says that nobody's tried the chroot route yet, and
> that makes me a little nervous.
>
> --Michael
>
> [1] https://github.com/mpashton/nixpkgs

I'd try the LD_PRELOAD trick before going for a chroot solution.
(Disclaimer: I'm not sure how to do the chroot thing, maybe someone
else on the list can tell you about it).

See <nixpkgs>/pkgs/applications/audio/spotify/* for an example of how
to use LD_PRELOAD to dynamically rewrite paths for a binary-only
program.

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list