Skip to content

Commit db4370d

Browse files
committed
Rust: Remove QL models for std::env sources.
1 parent 0d52541 commit db4370d

File tree

3 files changed

+20
-44
lines changed

3 files changed

+20
-44
lines changed

rust/ql/lib/codeql/rust/frameworks/stdlib/Env.qll

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,3 @@
44

55
private import rust
66
private import codeql.rust.Concepts
7-
8-
/**
9-
* A call to `std::env::args` or `std::env::args_os`.
10-
*/
11-
private class StdEnvArgs extends CommandLineArgsSource::Range {
12-
StdEnvArgs() {
13-
this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getResolvedPath() =
14-
["crate::env::args", "crate::env::args_os"]
15-
}
16-
}
17-
18-
/**
19-
* A call to `std::env::current_dir`, `std::env::current_exe` or `std::env::home_dir`.
20-
*/
21-
private class StdEnvDir extends CommandLineArgsSource::Range {
22-
StdEnvDir() {
23-
this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getResolvedPath() =
24-
["crate::env::current_dir", "crate::env::current_exe", "crate::env::home_dir"]
25-
}
26-
}
27-
28-
/**
29-
* A call to `std::env::var`, `std::env::var_os`, `std::env::vars` or `std::env::vars_os`.
30-
*/
31-
private class StdEnvVar extends EnvironmentSource::Range {
32-
StdEnvVar() {
33-
this.asExpr().getExpr().(CallExpr).getFunction().(PathExpr).getResolvedPath() =
34-
["crate::env::var", "crate::env::var_os", "crate::env::vars", "crate::env::vars_os"]
35-
}
36-
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| test.rs:8:34:8:84 | //... | Missing result: hasTaintFlow |
2+
| test.rs:9:37:9:87 | //... | Missing result: hasTaintFlow |
3+
| test.rs:41:20:41:36 | //... | Missing result: hasTaintFlow |
4+
| test.rs:45:20:45:36 | //... | Missing result: hasTaintFlow |
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
| test.rs:8:10:8:30 | ...::var(...) | Flow source 'EnvironmentSource' of type environment. |
2-
| test.rs:9:10:9:33 | ...::var_os(...) | Flow source 'EnvironmentSource' of type environment. |
3-
| test.rs:11:16:11:36 | ...::var(...) | Flow source 'EnvironmentSource' of type environment. |
4-
| test.rs:12:16:12:39 | ...::var_os(...) | Flow source 'EnvironmentSource' of type environment. |
5-
| test.rs:17:25:17:40 | ...::vars(...) | Flow source 'EnvironmentSource' of type environment. |
6-
| test.rs:22:25:22:43 | ...::vars_os(...) | Flow source 'EnvironmentSource' of type environment. |
7-
| test.rs:29:29:29:44 | ...::args(...) | Flow source 'CommandLineArgs' of type commandargs. |
8-
| test.rs:32:16:32:31 | ...::args(...) | Flow source 'CommandLineArgs' of type commandargs. |
9-
| test.rs:33:16:33:34 | ...::args_os(...) | Flow source 'CommandLineArgs' of type commandargs. |
10-
| test.rs:40:16:40:31 | ...::args(...) | Flow source 'CommandLineArgs' of type commandargs. |
11-
| test.rs:44:16:44:34 | ...::args_os(...) | Flow source 'CommandLineArgs' of type commandargs. |
12-
| test.rs:50:15:50:37 | ...::current_dir(...) | Flow source 'CommandLineArgs' of type commandargs. |
13-
| test.rs:51:15:51:37 | ...::current_exe(...) | Flow source 'CommandLineArgs' of type commandargs. |
14-
| test.rs:52:16:52:35 | ...::home_dir(...) | Flow source 'CommandLineArgs' of type commandargs. |
1+
#select
152
| test.rs:60:26:60:70 | ...::get(...) | Flow source 'RemoteSource' of type remote (DEFAULT). |
163
| test.rs:63:26:63:70 | ...::get(...) | Flow source 'RemoteSource' of type remote (DEFAULT). |
174
| test.rs:66:26:66:60 | ...::get(...) | Flow source 'RemoteSource' of type remote (DEFAULT). |
5+
testFailures
6+
| test.rs:8:34:8:84 | //... | Missing result: Alert[rust/summary/taint-sources] |
7+
| test.rs:9:37:9:87 | //... | Missing result: Alert[rust/summary/taint-sources] |
8+
| test.rs:11:62:11:99 | //... | Missing result: Alert[rust/summary/taint-sources] |
9+
| test.rs:12:51:12:88 | //... | Missing result: Alert[rust/summary/taint-sources] |
10+
| test.rs:17:44:17:81 | //... | Missing result: Alert[rust/summary/taint-sources] |
11+
| test.rs:22:47:22:84 | //... | Missing result: Alert[rust/summary/taint-sources] |
12+
| test.rs:29:57:29:94 | //... | Missing result: Alert[rust/summary/taint-sources] |
13+
| test.rs:32:50:32:87 | //... | Missing result: Alert[rust/summary/taint-sources] |
14+
| test.rs:33:53:33:90 | //... | Missing result: Alert[rust/summary/taint-sources] |
15+
| test.rs:40:35:40:72 | //... | Missing result: Alert[rust/summary/taint-sources] |
16+
| test.rs:44:38:44:75 | //... | Missing result: Alert[rust/summary/taint-sources] |
17+
| test.rs:50:57:50:94 | //... | Missing result: Alert[rust/summary/taint-sources] |
18+
| test.rs:51:57:51:94 | //... | Missing result: Alert[rust/summary/taint-sources] |
19+
| test.rs:52:55:52:92 | //... | Missing result: Alert[rust/summary/taint-sources] |

0 commit comments

Comments
 (0)