jailkit-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Jailkit-users] problems running commands, differing ldd output


From: Tzvi Edelman
Subject: Re: [Jailkit-users] problems running commands, differing ldd output
Date: Sun, 27 Apr 2014 21:51:58 +0300

Hi Rich, thanks for taking a whack at this.

Running `which grep` does return "/bin/grep".

Here is my PATH:
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Running `ls -l /bin/grep` returns
  -rwxr-xr-x 1 root root 149536 May 27  2012 /bin/grep

I'm really curious why the execve fails with ENOENT. 

# strace from the bash session in which I invoked grep
/tmp/trace-20140426-213214.15117:write(2, "\10\10\10\10\10\10grep qtest /etc/passwd ", 29) = 29

# strace from the process attempting to launch grep (filtered for "grep")
/tmp/trace-20140426-213214.15274:execve("/bin/grep", ["grep", "qtest", "/etc/passwd"], [/* 7 vars */]) = -1 ENOENT (No such file or directory)
/tmp/trace-20140426-213214.15274:stat64("/bin/grep", {st_mode=S_IFREG|0755, st_size=149536, ...}) = 0
/tmp/trace-20140426-213214.15274:stat64("/bin/grep", {st_mode=S_IFREG|0755, st_size=149536, ...}) = 0
/tmp/trace-20140426-213214.15274:stat64("/bin/grep", {st_mode=S_IFREG|0755, st_size=149536, ...}) = 0
/tmp/trace-20140426-213214.15274:access("/bin/grep", X_OK)               = 0
/tmp/trace-20140426-213214.15274:stat64("/bin/grep", {st_mode=S_IFREG|0755, st_size=149536, ...}) = 0
/tmp/trace-20140426-213214.15274:access("/bin/grep", R_OK)               = 0
/tmp/trace-20140426-213214.15274:open("/bin/grep", O_RDONLY|O_LARGEFILE) = 3
/tmp/trace-20140426-213214.15274:write(2, "bash: /bin/grep: No such file or"..., 43) = 43

Do any of you any ideas about execve failure?

Thanks - Tzvi.

--
Tzvi Edelman cell:+972-50-849-8805  <address@hidden> H.323:tevid.no-ip.biz


On Sun, Apr 27, 2014 at 12:25 PM, Richard Scott <address@hidden> wrote:

Hi,

When in your jail try this:

 

$ which grep

does it list /bin/grep or say its not found?

If not found, your PATH isn't set correctly.

Rich

On 26/04/2014 23:50, Tzvi Edelman wrote:

Hi,
 
I am using jailkit-2.17 in debian wheezy, and seeing the following:

When I try to do something with grep in a jailed session, I get back
  bash: /bin/grep: No such file or directory
 
# ldd from outside the jail:
$ ldd /bin/grep
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f90000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6f7a000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6f52000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6e23000)
        /lib/arm-linux-gnueabihf/ld-linux.so.3 => /lib/ld-linux-armhf.so.3 (0xb6f9d000)
 
# ldd from inside the jail:
$ ldd /bin/grep
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6f74000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6f4c000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6e1d000)
/lib/arm-linux-gnueabihf/ld-linux.so.3 => /lib/ld-linux-armhf.so.3 (0xb6f82000)
 
The line for libcofi_rpi.so is missing from the ldd-inside, but the file (/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so) is inside the jail!
 
When I look at strace output (strace running outside the jail watching jailed processes), I see that the execve of /bin/grep fails with ENOENT, but the file for /bin/grep is there.
 
Any ideas?
 
Thanks - Tzvi.
--
Tzvi Edelman cell:+972-50-849-8805  <address@hidden> H.323:tevid.no-ip.biz

_______________________________________________
Jailkit-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/jailkit-users

_______________________________________________
Jailkit-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/jailkit-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]