public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Edenfield <kutulu@kutulu.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user]  Re: bash stopped running python scripts...
Date: Tue, 04 Aug 2009 08:59:56 -0400	[thread overview]
Message-ID: <4A7830CC.6020405@kutulu.org> (raw)
In-Reply-To: <87prbbq1bk.fsf@newton.gmurray.org.uk>

On 8/4/2009 7:13 AM, Graham Murray wrote:
> Remy Blank<remy.blank@pobox.com>  writes:
>
>> The whole issue seems to be handled quite strangely IMO. You would think
>> breaking Python for all ~x86 is a major offense...
>
> It did not break for all ~x86. I have 2 systems both running ~x86, both
> have emerged (but not made active) python-3.1, /usr/bin/python is a bash
> script on both yet emerge works with no problems. The only non-standard
> things are that I have unmasked gcc-4.4.1 and am using git 2.6.31-rc
> kernels.

Aha.  I think I've discovered the "problem".  There was a change in the 
kernel execl() call between 2.6.27 and 2.6.28:

--- linux-2.6.27-hardened-r3/fs/binfmt_script.c 2008-10-09 
18:13:53.000000000 -0400
+++ linux-2.6.28-hardened/fs/binfmt_script.c    2008-12-24 
18:26:37.000000000 -0500
@@ -22,14 +22,15 @@
         char interp[BINPRM_BUF_SIZE];
         int retval;

-       if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || 
(bprm->sh_bang))
+       if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') ||
+           (bprm->recursion_depth > BINPRM_MAX_RECURSION))
                 return -ENOEXEC;
         /*
          * This section does the #! interpretation.
          * Sorta complicated, but hopefully it will work.  -TYT
          */

-       bprm->sh_bang = 1;
+       bprm->recursion_depth++;
         allow_write_access(bprm->file);
         fput(bprm->file);
         bprm->file = NULL;


The kernel >= 2.6.28 now supports nesting up to 4 levels of script in 
the #! lines, if I'm reading that right, whereas < 2.6.28 it only 
supported 1 level.  I'll go update the b.g.o entry and try upgrading my 
kernel.  Though I dunno what that means for Gentoo/FreeBSD.

--Mike



  reply	other threads:[~2009-08-04 12:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03 20:56 [gentoo-user] bash stopped running python scripts Mike Edenfield
2009-08-03 21:03 ` Alan McKinnon
2009-08-03 21:22   ` Mike Edenfield
2009-08-03 21:48     ` Alan McKinnon
2009-08-03 22:08       ` Mike Edenfield
2009-08-04  8:05         ` Alan McKinnon
2009-08-03 21:14 ` [gentoo-user] " Remy Blank
2009-08-03 21:28   ` Mike Edenfield
2009-08-04 11:13   ` Graham Murray
2009-08-04 12:59     ` Mike Edenfield [this message]
2009-08-04 17:41       ` Remy Blank

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=4A7830CC.6020405@kutulu.org \
    --to=kutulu@kutulu.org \
    --cc=gentoo-user@lists.gentoo.org \
    /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