Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding "shell=true" to run invocation does not work nicely with strace runner #47

Open
GoogleCodeExporter opened this issue Mar 26, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

The idea of the "shell=true" argument is that the entire command line is 
invoked via the shell. However, when StraceRunner is used, the independent 
command-line arguments are merely appended to the strace line, converted to a 
command-line. This means that a command like "touch foo.txt; touch bar.txt" 
will result in strace invocation "strace -fo /tmp/tmp6VNsRF -e 
trace=open,stat,stat64,lstat,lstat64,execve,exit_group,chdir,mkdir,rename,clone,
vfork,fork,symlink,creat touch foo.txt ; touch other.txt", which will mean that 
"bar.txt" does not get marked as an output of the command: "touch foo.txt ; 
touch bar.txt": { "foo.txt": "output-d41d8cd98f00b204e9800998ecf8427e" }

The real fix is to instead translate such a line to "strace -fo /tmp/tmp6VNsRF 
-e 
trace=open,stat,stat64,lstat,lstat64,execve,exit_group,chdir,mkdir,rename,clone,
vfork,fork,symlink,creat /bin/sh -c 'touch foo.txt ; touch other.txt'", and not 
pass the shell=True to the underlying subprocess.Popen.

Original issue reported on code.google.com by nuutti.k...@gmail.com on 9 Jul 2013 at 11:58

@GoogleCodeExporter
Copy link
Author

Sorry for very slow response,

I met same issue, and wrote a patch. It modifies structure of argument and 
shell flag before calling strace.

I would be happy if this is still useful.

Takaaki Aoki

Original comment by Aoki.Takaaki on 7 Aug 2014 at 7:06

  • Added labels: ****
  • Removed labels: ****

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants