Re: Broken executable-in-var (was: Announcing my new old repository)

Thomas Leonard <[email protected]>
Newsgroups gmane.comp.file-systems.zero-install.devel
Message-ID <CAG4opy9q_e+Gr8089DwjZUa6cm4ZR+=usWCaNgXzs=oLYdu12Q@mail.gmail.com>
On 1 August 2015 at 14:35, Bart van Strien <[email protected]> wrote:
> On 01/08/15 15:00, Thomas Leonard wrote:
>
> Presumably it can't find gpg for some reason. This might give a clue:
>
> $ 00install run -w'strace -f -e process'
> http://0install.net/2007/interfaces/FeedLint.xml
> http://0install.bartbes.com/love.xml
>
>
> So turns out this is related to a problem I had earlier, worked around and
> promptly forgot about. On my system the stubs generated by executable-in-var
> are broken. I first came across this when packaging kotlin
> (http://0install.bartbes.com/kotlin.xml), but apparently that's causing this
> gpg failure in feedlint, too.

Do you have any strange security policies in place (SELinux, etc)?

> Here's the contents on the generated 'ZEROINSTALL_GPG' file:
>
> #!/home/bartbes/.cache/0install.net/implementations/sha256new_YEPNC3CZ7CVC6ZJNS3PALMWAOKPHLKZP65KLLNICQ5HYFRDOKTNQ/files/0install
> runenv

What happens if you run this file directly? (it should run, but
complain "Environment variable 'zeroinstall_runenv_ZEROINSTALL_GPG'
not set")

> I never quite figured out why it doesn't work, but it doesn't. An error I
> saw whilst running kotlin either truncated the command in the message, or
> truncated the command trying to run it, so it may be related to the long
> file path.
>
> For JAVACMD, I manually changed the file to the following, after which it
> worked fine:
>
> #!/bin/sh
> exec
> /home/bartbes/.cache/0install.net/implementations/sha256new_YEPNC3CZ7CVC6ZJNS3PALMWAOKPHLKZP65KLLNICQ5HYFRDOKTNQ/files/0install
> runenv JAVACMD "$@"
>
>
> Maybe the script generation file should emit that instead? Possibly with a
> basename call, like this:
>
> #!/bin/sh
> exec
> /home/bartbes/.cache/0install.net/implementations/sha256new_YEPNC3CZ7CVC6ZJNS3PALMWAOKPHLKZP65KLLNICQ5HYFRDOKTNQ/files/0install
> runenv $(basename "$0") "$@"
>
>
> Which, as far as I can tell, is valid syntax in POSIX sh (and I tested this
> with bash4/bash3/zsh/dash), so it should be perfectly portable. I just
> replaced the ZEROINSTALL_GPG's file contents with what I just suggested and
> feedlint now works fine (and fails on a redirect instead...).



-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.