payu-org / payu

A workflow management tool for numerical models on the NCI computing systems
Apache License 2.0
18 stars 25 forks source link

User-scripts error-handling, commands and tests #452

Open jo-basevi opened 1 day ago

jo-basevi commented 1 day ago

To be able to run commands such as echo "some_data" > input.txt that are in payu documentation, it requires use of shell=True. So there's some security issues with using shell=True (https://docs.python.org/3/library/subprocess.html#security-considerations). However as the user scripts have typically been user defined .sh files run with /bin/bash, it could contain malicious code anyway..

I added a needs_subprocess_shell function that checks for any shell specific values. The list I've added might not be exhaustive. The question I am not sure on is that function even needed, and should all the user script commands just be run with shell=True?

Closes #448, closes #444

pep8speaks commented 1 day ago

Hello @jo-basevi! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2024-07-01 01:05:59 UTC