[gentoo-user] Re: bash stopped running python scripts...

2009-08-04 Thread Remy Blank
Mike Edenfield wrote:
> Though I dunno what that means for Gentoo/FreeBSD.

It means that relying on linux-only, non-POSIX compliant behavior is a
very bad idea ;-)

-- Remy



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] Re: bash stopped running python scripts...

2009-08-04 Thread Mike Edenfield

On 8/4/2009 7:13 AM, Graham Murray wrote:

Remy Blank  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.0 -0400
+++ linux-2.6.28-hardened/fs/binfmt_script.c2008-12-24 
18:26:37.0 -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



Re: [gentoo-user] Re: bash stopped running python scripts...

2009-08-04 Thread Graham Murray
Remy Blank  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. 



Re: [gentoo-user] Re: bash stopped running python scripts...

2009-08-03 Thread Mike Edenfield

On 8/3/2009 5:14 PM, Remy Blank wrote:

Mike Edenfield wrote:

I dunno what I did, but I've managed to break python shell scripts,
which of course is playing havoc with portage.


http://bugs.gentoo.org/show_bug.cgi?id=279915

The whole issue seems to be handled quite strangely IMO. You would think
breaking Python for all ~x86 is a major offense...


Ah, thanks.  Usually my google searches pick up stuff from 
bugs.gentoo.org but this time it didn't, guess it was too new :\


And yes, reverting /usr/bin/python to a symlink instead of a shell 
script does solve the problem.  I'll just follow the bug for now and 
mask off eselect-python.


--Mike



[gentoo-user] Re: bash stopped running python scripts...

2009-08-03 Thread Remy Blank
Mike Edenfield wrote:
> I dunno what I did, but I've managed to break python shell scripts, 
> which of course is playing havoc with portage.

http://bugs.gentoo.org/show_bug.cgi?id=279915

The whole issue seems to be handled quite strangely IMO. You would think
breaking Python for all ~x86 is a major offense...

-- Remy



signature.asc
Description: OpenPGP digital signature