mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Valery Reznic <valery_reznic@yahoo.com>
Cc: David Newall <davidn@davidnewall.com>,
	linux-kernel@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-man@vger.kernel.org
Subject: Re: execve for script don't return ENOEXEC, bug ?
Date: Sun, 21 Mar 2010 20:16:19 +0100	[thread overview]
Message-ID: <20100321191619.GA5235@sig21.net> (raw)
In-Reply-To: <876436.86374.qm@web110307.mail.gq1.yahoo.com>

(Cc: man page maintainer)

On Sun, Mar 21, 2010 at 01:33:28AM -0700, Valery Reznic wrote:
> --- On Sat, 3/20/10, David Newall <davidn@davidnewall.com> wrote:
> > Valery Reznic wrote:
> > > execve's man page state that script's interprtert
> > > should not be interpreter itself:
...
> > > To me it looks like  execve and it's man page
> > > disagree. Do you know is it new intended behaviour of execve
> > > and just man page wasn't update or it's a bug in execve ?
> > 
> > Code and man pages do sometimes disagree.  I shan't
> > address what the correct behaviour is, because if you ask
> > three people you're sure to get four different answers,
> > rather let's discuss what is desirable.  Without
> > looking at how it works, we observe that a.sh can be
> > executed without error.  If a.out were written in C it
> > would qualify as an acceptable interpreter according to the
> > man page, so why should it not qualify if it is
> > interpreted?  I think it's desirable that it does
> > qualify.  There could be sound reasons why only one
> > level of interpreter can be invoked.  Perhaps loading a
> > script interpreter is done as an exception in exec, and it's
> > too ugly to allow recursive exceptions.  That would be
> > a fair reason.  But if there's no reason, then don't
> > have the restriction*.  Linux now apparently does
> > permit interpreted interpreters, and I say that is the
> > desirable result.
> For some reason I tough that ENOEXEC for 'interpreted interpreter' is posix
> requirement. But after closer look it appear to be only arbitrary restriction
> now lifted in Linux.
> 
> I had a look at the source http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/fs/binfmt_misc.c
> and it's obvious that 'interpreted interpreter' is intentional (and recursion depth is 4).
> So, execve is behave as it should and only man page is lag behind.
> Thank you for you help/
> 
> 
> Just curios - who use this feature in the real world and what for ?

It seems to have been changed in commit bf2a9a39639b8b51377905397a5005f444e9a892.
Maybe you could ask the author for details.


Johannes

      reply	other threads:[~2010-03-21 19:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 10:56 Valery Reznic
2010-03-19 21:07 ` Andrew Morton
2010-03-20  0:37   ` David Newall
2010-03-20  6:42     ` Valery Reznic
2010-03-20  9:41       ` David Newall
2010-03-20 12:56         ` Valery Reznic
2010-03-20 17:57           ` David Newall
2010-03-21  8:33             ` Valery Reznic
2010-03-21 19:16               ` Johannes Stezenbach [this message]

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=20100321191619.GA5235@sig21.net \
    --to=js@sig21.net \
    --cc=davidn@davidnewall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=valery_reznic@yahoo.com \
    /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®