rekado <rek...@elephly.net> skribis:

> ---- On Fri, 22 May 2015 05:53:51 +0800 Ludovic Courtès<l...@gnu.org> wrote 
> ---- 
>  > Could you try this: 
>  >  
>  > --8<---------------cut here---------------start------------->8--- 
>  > (chdir "/tmp") 
>  > (setgroups #()) 
>  > (setgid 30000) 
>  > (setuid 30001) 
>  > (pk 'uid/gid (getuid) (getgid)) 
>  > (pk 'euid/egid (geteuid) (getegid)) 
>  > (let loop ((i 3)) 
>  >   (when (< i 1024) 
>  >     (false-if-exception (close-fdes i)) 
>  >     (loop (+ 1 i)))) 
>  > (execl 
> "/gnu/store/cnqmkmj40jmssnx6fkf9n0n3bqj5x426-guile-2.0.11/bin/guile" "guile" 
>  >        "-c" "(pk 'running (getuid) (geteuid))") 
>  > --8<---------------cut here---------------end--------------->8--- 
>  >  
>  > and then as root run: 
>  >  
>  >   # guile the-above-file.scm 
>  >  
>  > It should return zero and print: 
>  >  
>  > --8<---------------cut here---------------start------------->8--- 
>  > ;;; (uid/gid 30001 30000) 
>  >  
>  > ;;; (euid/egid 30001 30000) 
>  >  
>  > ;;; (running 30001 30001) 
>  > --8<---------------cut here---------------end--------------->8--- 
>
> I ran it in a guile REPL (as root) and I got the first two outputs, but an 
> error on (execl ...).  It's an unhelpful message:
>
>     ERROR: In procedure execl:
>     ERROR: In procedure execl: Permission denied

Great, that means that we have a reduced test case now!

Now, could you try to comment out some of the lines before the ‘execl’
until you find which one is responsible for that?

IIRC you said that
"/gnu/store/cnqmkmj40jmssnx6fkf9n0n3bqj5x426-guile-2.0.11/bin/guile" is
555, so normally every user on the machine can run it.  It can only
imagine an obscure kernel or file system setting that would somehow
prevent execution, but we’ll see.

Thank you,
Ludo’.

Reply via email to