Menu

#3 0.6 Document need for use of absolute path to PROGRAM

open
nobody
None
5
2009-12-23
2009-12-23
Jari Aalto
No

Forwarded Cf. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=183046
"too hard to run it on binaries not in path"

Version: 0.6
Severity: minor

If I want to run fuzz on something that is not in my path -- because I
just wrote the program and compiled it to test some library functions,
say, it makes it nonobvious how to do this, because after frking the
child each time, it chdirs it to /tmp.

fork() = 10500
[pid 10500] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid 10500] chdir("/tmp") = 0
[pid 10500] dup2(7, 0) = 0
[pid 10500] close(7) = 0
[pid 10500] close(8) = 0
[pid 10500] dup2(5, 1) = 1
[pid 10500] dup(2) = 7
[pid 10500] fcntl64(7, F_SETFD, 0xbfffce88) = 0
[pid 10500] dup2(5, 2) = 2
[pid 10500] close(5) = 0
[pid 10500] execve("./catstack", ["./catstack", "-"], [/* 42 vars */]) = -1 ENOENT (No such file or directory)
[pid 10500] write(7, "Exec failed.\n", 13Exec failed.
) = 13
[pid 10500] write(7, "No such file or directory", 25No such file or directory) = 25

So I have to strace it to figure out why it's failing, and then
learn to use fuzz `pwd`/myprogram. Bleh.

The only reason I can see to chdir at all is to prevent the program crashing
and leaving droppings in the pwd. So perhaps this chdir is generally useful,
but I think it should at least be documented.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB