forked from astral-sh/ruff
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
109 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 105 additions & 87 deletions
192
...rules/flake8_bandit/snapshots/ruff_linter__rules__flake8_bandit__tests__S605_S605.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,147 +1,165 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/flake8_bandit/mod.rs | ||
--- | ||
S605.py:7:11: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
6 | # Check all shell functions. | ||
7 | os.system("true") | ||
| ^^^^^^ S605 | ||
8 | os.popen("true") | ||
9 | os.popen2("true") | ||
| | ||
|
||
S605.py:8:10: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
6 | # Check all shell functions. | ||
7 | os.system("true") | ||
8 | os.popen("true") | ||
| ^^^^^^ S605 | ||
9 | os.popen2("true") | ||
10 | os.popen3("true") | ||
S605.py:8:11: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
7 | # Check all shell functions. | ||
8 | os.system("true") | ||
| ^^^^^^ S605 | ||
9 | os.popen("true") | ||
10 | os.popen2("true") | ||
| | ||
|
||
S605.py:9:11: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
S605.py:9:10: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
7 | os.system("true") | ||
8 | os.popen("true") | ||
9 | os.popen2("true") | ||
| ^^^^^^ S605 | ||
10 | os.popen3("true") | ||
11 | os.popen4("true") | ||
7 | # Check all shell functions. | ||
8 | os.system("true") | ||
9 | os.popen("true") | ||
| ^^^^^^ S605 | ||
10 | os.popen2("true") | ||
11 | os.popen3("true") | ||
| | ||
|
||
S605.py:10:11: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
8 | os.popen("true") | ||
9 | os.popen2("true") | ||
10 | os.popen3("true") | ||
8 | os.system("true") | ||
9 | os.popen("true") | ||
10 | os.popen2("true") | ||
| ^^^^^^ S605 | ||
11 | os.popen4("true") | ||
12 | popen2.popen2("true") | ||
11 | os.popen3("true") | ||
12 | os.popen4("true") | ||
| | ||
|
||
S605.py:11:11: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
9 | os.popen2("true") | ||
10 | os.popen3("true") | ||
11 | os.popen4("true") | ||
9 | os.popen("true") | ||
10 | os.popen2("true") | ||
11 | os.popen3("true") | ||
| ^^^^^^ S605 | ||
12 | popen2.popen2("true") | ||
13 | popen2.popen3("true") | ||
12 | os.popen4("true") | ||
13 | popen2.popen2("true") | ||
| | ||
|
||
S605.py:12:15: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
S605.py:12:11: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
10 | os.popen3("true") | ||
11 | os.popen4("true") | ||
12 | popen2.popen2("true") | ||
| ^^^^^^ S605 | ||
13 | popen2.popen3("true") | ||
14 | popen2.popen4("true") | ||
10 | os.popen2("true") | ||
11 | os.popen3("true") | ||
12 | os.popen4("true") | ||
| ^^^^^^ S605 | ||
13 | popen2.popen2("true") | ||
14 | popen2.popen3("true") | ||
| | ||
|
||
S605.py:13:15: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
11 | os.popen4("true") | ||
12 | popen2.popen2("true") | ||
13 | popen2.popen3("true") | ||
11 | os.popen3("true") | ||
12 | os.popen4("true") | ||
13 | popen2.popen2("true") | ||
| ^^^^^^ S605 | ||
14 | popen2.popen4("true") | ||
15 | popen2.Popen3("true") | ||
14 | popen2.popen3("true") | ||
15 | popen2.popen4("true") | ||
| | ||
|
||
S605.py:14:15: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
12 | popen2.popen2("true") | ||
13 | popen2.popen3("true") | ||
14 | popen2.popen4("true") | ||
12 | os.popen4("true") | ||
13 | popen2.popen2("true") | ||
14 | popen2.popen3("true") | ||
| ^^^^^^ S605 | ||
15 | popen2.Popen3("true") | ||
16 | popen2.Popen4("true") | ||
15 | popen2.popen4("true") | ||
16 | popen2.Popen3("true") | ||
| | ||
|
||
S605.py:15:15: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
13 | popen2.popen3("true") | ||
14 | popen2.popen4("true") | ||
15 | popen2.Popen3("true") | ||
13 | popen2.popen2("true") | ||
14 | popen2.popen3("true") | ||
15 | popen2.popen4("true") | ||
| ^^^^^^ S605 | ||
16 | popen2.Popen4("true") | ||
17 | commands.getoutput("true") | ||
16 | popen2.Popen3("true") | ||
17 | popen2.Popen4("true") | ||
| | ||
|
||
S605.py:16:15: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
14 | popen2.popen4("true") | ||
15 | popen2.Popen3("true") | ||
16 | popen2.Popen4("true") | ||
14 | popen2.popen3("true") | ||
15 | popen2.popen4("true") | ||
16 | popen2.Popen3("true") | ||
| ^^^^^^ S605 | ||
17 | commands.getoutput("true") | ||
18 | commands.getstatusoutput("true") | ||
17 | popen2.Popen4("true") | ||
18 | commands.getoutput("true") | ||
| | ||
|
||
S605.py:17:20: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
S605.py:17:15: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
15 | popen2.Popen3("true") | ||
16 | popen2.Popen4("true") | ||
17 | commands.getoutput("true") | ||
15 | popen2.popen4("true") | ||
16 | popen2.Popen3("true") | ||
17 | popen2.Popen4("true") | ||
| ^^^^^^ S605 | ||
18 | commands.getoutput("true") | ||
19 | commands.getstatusoutput("true") | ||
| | ||
|
||
S605.py:18:20: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
16 | popen2.Popen3("true") | ||
17 | popen2.Popen4("true") | ||
18 | commands.getoutput("true") | ||
| ^^^^^^ S605 | ||
18 | commands.getstatusoutput("true") | ||
19 | commands.getstatusoutput("true") | ||
20 | subprocess.getoutput("true") | ||
| | ||
|
||
S605.py:18:26: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
S605.py:19:26: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
16 | popen2.Popen4("true") | ||
17 | commands.getoutput("true") | ||
18 | commands.getstatusoutput("true") | ||
17 | popen2.Popen4("true") | ||
18 | commands.getoutput("true") | ||
19 | commands.getstatusoutput("true") | ||
| ^^^^^^ S605 | ||
20 | subprocess.getoutput("true") | ||
21 | subprocess.getstatusoutput("true") | ||
| | ||
|
||
S605.py:23:11: S605 Starting a process with a shell, possible injection detected | ||
S605.py:20:22: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
18 | commands.getoutput("true") | ||
19 | commands.getstatusoutput("true") | ||
20 | subprocess.getoutput("true") | ||
| ^^^^^^ S605 | ||
21 | subprocess.getstatusoutput("true") | ||
| | ||
|
||
S605.py:21:28: S605 Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell` | ||
| | ||
19 | commands.getstatusoutput("true") | ||
20 | subprocess.getoutput("true") | ||
21 | subprocess.getstatusoutput("true") | ||
| ^^^^^^ S605 | ||
| | ||
21 | # Check command argument looks unsafe. | ||
22 | var_string = "true" | ||
23 | os.system(var_string) | ||
|
||
S605.py:26:11: S605 Starting a process with a shell, possible injection detected | ||
| | ||
24 | # Check command argument looks unsafe. | ||
25 | var_string = "true" | ||
26 | os.system(var_string) | ||
| ^^^^^^^^^^ S605 | ||
24 | os.system([var_string]) | ||
25 | os.system([var_string, ""]) | ||
27 | os.system([var_string]) | ||
28 | os.system([var_string, ""]) | ||
| | ||
|
||
S605.py:24:11: S605 Starting a process with a shell, possible injection detected | ||
S605.py:27:11: S605 Starting a process with a shell, possible injection detected | ||
| | ||
22 | var_string = "true" | ||
23 | os.system(var_string) | ||
24 | os.system([var_string]) | ||
25 | var_string = "true" | ||
26 | os.system(var_string) | ||
27 | os.system([var_string]) | ||
| ^^^^^^^^^^^^ S605 | ||
25 | os.system([var_string, ""]) | ||
28 | os.system([var_string, ""]) | ||
| | ||
|
||
S605.py:25:11: S605 Starting a process with a shell, possible injection detected | ||
S605.py:28:11: S605 Starting a process with a shell, possible injection detected | ||
| | ||
23 | os.system(var_string) | ||
24 | os.system([var_string]) | ||
25 | os.system([var_string, ""]) | ||
26 | os.system(var_string) | ||
27 | os.system([var_string]) | ||
28 | os.system([var_string, ""]) | ||
| ^^^^^^^^^^^^^^^^ S605 | ||
| | ||
|
||
|