From: Willy Tarreau <willy@w.ods.org>
To: Pozsar Balazs <pozsy@uhulinux.hu>
Cc: Hans-Peter Jansen <hpj@urpla.net>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [BUG?] binfmt_script: interpreted interpreter doesn't work
Date: Sun, 15 Sep 2002 21:34:10 +0200 [thread overview]
Message-ID: <20020915193410.GA17662@alpha.home.local> (raw)
In-Reply-To: <Pine.GSO.4.30.0209152057580.22107-100000@balu>
On Sun, Sep 15, 2002 at 09:13:30PM +0200, Pozsar Balazs wrote:
> This is because the kernel cannot execute the "/home/pozsy/b" script, and
> then bash tries to interpret it itself. (but this in *not* what I want: I
> want the "b" 'script' interpreted by the "a" script).
> If you try this:
> strace -f /home/pozsy/b
> You will get this:
> execve("/home/pozsy/b", ["/home/pozsy/b"], [/* 24 vars */]) = 0
> strace: exec: Exec format error
>
> The root of the problem is still that /home/pozsy/b cannot be execve'd.
> That is a kernel problem.
the problem is far simpler :
when you execute /home/pozsy/b, the kernel should have to launch /home/pozsy/a
with /home/pozsy/b in argv[0]. If it accepted to run it, it would run sh (or
perl or any other interpreter) with /home/pozsy/a in argv[0], thus loosing
track of /home/pozsy/b.
The simplest solution for you is to write a little C wrapper to start your
interpreted interpreter with the script in argument. Written with dietlibc or
anything like it, it would not be more than a few hundred bytes long.
Cheers,
Willy
next prev parent reply other threads:[~2002-09-15 19:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200209152055.05322.hpj@urpla.net>
2002-09-15 19:13 ` Pozsar Balazs
2002-09-15 19:34 ` Willy Tarreau [this message]
2002-09-15 21:00 ` Pozsar Balazs
2002-09-15 17:15 Pozsar Balazs
2002-09-15 19:05 ` Gilad Ben-Yossef
2002-09-15 19:14 ` Pozsar Balazs
2002-09-15 20:06 ` Ingo Oeser
2002-09-15 21:04 ` Pozsar Balazs
2002-09-15 21:18 ` Mark Veltzer
2002-09-15 21:19 ` jbradford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020915193410.GA17662@alpha.home.local \
--to=willy@w.ods.org \
--cc=hpj@urpla.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pozsy@uhulinux.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®