[PATCH] uclibc execvp stops at EPERM (glibc will try next PATH dir)

Denis Vlasenko vda.linux at googlemail.com
Fri Jul 6 16:37:49 UTC 2007


Hi Mike,

This is what uclibc execvp does if a directory in PATH
cannot be entered by current user:

execve("/root/bin/env", ["env", "-", "nmeter", "%t %c x %x p%p f %f b %b m %m if"...], [/* 32 vars */]) = -1 EACCES (Permission denied)
write(2, "setuidgid", 9)                = 9
write(2, ": ", 2)                       = 2
write(2, "exec ", 5)                    = 5
write(2, "env", 3)                      = 3
write(2, ": ", 2)                       = 2
write(2, "Permission denied", 17)       = 17

glibc does not stop, it tries next PATH element:

execve("/root/bin/env", ["env", "-", "nmeter", "%t %c x %x p%p f %f b %b m %m if"...], [/* 32 vars */]) = -1 EACCES (Permission denied)
execve("/bin/env", ["env", "-", "nmeter", "%t %c x %x p%p f %f b %b m %m if"...], [/* 32 vars */]) = 0

One possible fix attached.
(you probably want to remove now-unused CHECK_ENOEXEC
label as well...).
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uClibc-0.9.29.execvp.patch
Type: text/x-diff
Size: 624 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20070706/7ee13c6e/attachment-0002.bin 


More information about the uClibc mailing list