subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Add compression if requested if compress: cmd_str = " ".join(cmd) + f" | gzip > {backup_path}" result = subprocess.run(cmd_str, shell=True, capture_output=True, text=True) else: # Run pg_dump and redirect to file with open(backup_path, 'w') as f:- Confidence
- 99% confidence
- Finding
- result = subprocess.run(cmd_str, shell=True, capture_output=True, text=True)
