Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created October 18, 2011 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansissel/1294902 to your computer and use it in GitHub Desktop.
Save jordansissel/1294902 to your computer and use it in GitHub Desktop.
Shells trying to be too clever.
% strace -fo /tmp/x -e trace=file,execve sh -c 'exec ./fizzle.sh'
...
13204 access("/bin/sh", R_OK) = 0
13204 execve("/home/jls/projects/experiments/puppet/fizzle.sh", ["./fizzle.sh"], [/* 112 vars */]) = -1 ENOEXEC (Exec format error)
13204 open("/home/jls/projects/experiments/puppet/fizzle.sh", O_RDONLY) = 3
13204 stat("/home/jls/projects/experiments/puppet", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
13204 stat(".", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
13204 stat(".", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
13204 stat("/home/jls/.rvm/gems/ruby-1.8.7-p334/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/home/jls/.rvm/gems/ruby-1.8.7-p334@global/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/home/jls/.rvm/rubies/ruby-1.8.7-p334/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/home/jls/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/home/jls/local/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/usr/local/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/usr/bin/sh", 0x7fffececd540) = -1 ENOENT (No such file or directory)
13204 stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=960576, ...}) = 0
13204 stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=960576, ...}) = 0
13204 access("/bin/sh", X_OK) = 0
13204 stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=960576, ...}) = 0
13204 access("/bin/sh", R_OK) = 0
13204 stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=960576, ...}) = 0
13204 stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=960576, ...}) = 0
13204 access("/bin/sh", X_OK) = 0
13204 stat("/bin/sh", {st_mode=S_IFREG|0755, st_size=960576, ...}) = 0
13204 access("/bin/sh", R_OK) = 0
13204 open("/home/jls/projects/experiments/puppet/fizzle.sh", O_RDONLY) = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment