-
Notifications
You must be signed in to change notification settings - Fork 82
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
Avoid shell injection problems by using subprocess.run() #95
Conversation
run_shell_command was parsing the command line passed, so it was subject to shell injections and, on Windows, wouldn't handle filenames correctly -- it would split on spaces (which are common in Windows filenames) and interpret \s (also common in Windows file names) as control codes. To do this, I got rid of defaceTpl, which was a shell command template, in favour of hardcoding pydeface as the anonymizing algorithm, and as a result of that I also bumped the major version.
As I said in the commit message, this has the unfortunate side effect of forcing out Since this changes the API, I did a major version bump. Which is unfortunate because there isn't really any other major change to speak of in here, and because probably most people aren't using this part of the API anyway. I'm not sure if it's a good idea, I'd like some feedback one way or the other. I could probably resurrect |
Also, remove the layer of indirection of putting the requirements outside of setup.py.
I don't think I like the idea of having dependencies like pydeface. |
We can split the PR into two PR. We can get rid of defaceTpl and suggest a new PR with something I described above. |
Hi @kousu, |
I'm sorry, I'm not sure why I never responded to this!! You answered it the day of and then I just dropped it, even though I asked for feedback. Sometimes Github gets lost in my inbox? I'm not sure really. I think it might be a problem with my spam filter, maybe being overly picky about some of Github's MXes and not others, or maybe I just wasn't paying attention.
Yeah I'd be happy to take care of this! |
Well, that's great news. I'm not a Windows user either so I can't help you out there, but congrats on the tidy work :) |
Oh sorry, I assume you were a Windows user because you mentioned opened #83 regarding windows paths 😅 . |
Oh geez I forgot about #83. I was helping someone in my lab who was a Windows user. But it was a long time ago. |
No description provided.