-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SandboxCallCheck: new check for invalid sandbox calls
Catches multiple arguments passed to function, and colon separated path. Resolves: #644 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
- Loading branch information
Showing
4 changed files
with
64 additions
and
0 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
2 changes: 2 additions & 0 deletions
2
testdata/data/repos/standalone/SandboxCallCheck/InvalidSandboxCall/expected.json
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{"__class__": "InvalidSandboxCall", "category": "SandboxCallCheck", "package": "InvalidSandboxCall", "version": "0", "line": "addpredict /etc/dfs:/dev/zfs", "lineno": 7} | ||
{"__class__": "InvalidSandboxCall", "category": "SandboxCallCheck", "package": "InvalidSandboxCall", "version": "0", "line": "addwrite /dev /etc", "lineno": 11} |
17 changes: 17 additions & 0 deletions
17
testdata/data/repos/standalone/SandboxCallCheck/InvalidSandboxCall/fix.patch
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
diff -Naur standalone/SandboxCallCheck/InvalidSandboxCall/InvalidSandboxCall-0.ebuild fixed/SandboxCallCheck/InvalidSandboxCall/InvalidSandboxCall-0.ebuild | ||
--- standalone/SandboxCallCheck/InvalidSandboxCall/InvalidSandboxCall-0.ebuild | ||
+++ fixed/SandboxCallCheck/InvalidSandboxCall/InvalidSandboxCall-0.ebuild | ||
@@ -4,9 +4,11 @@ SLOT="0" | ||
LICENSE="BSD" | ||
|
||
src_compile() { | ||
- addpredict /etc/dfs:/dev/zfs | ||
+ addpredict /etc/dfs | ||
+ addpredict /dev/zfs | ||
} | ||
|
||
src_test() { | ||
- addwrite /dev /etc | ||
+ addwrite /dev | ||
+ addwrite /etc | ||
} |
12 changes: 12 additions & 0 deletions
12
testdata/repos/standalone/SandboxCallCheck/InvalidSandboxCall/InvalidSandboxCall-0.ebuild
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
DESCRIPTION="Ebuild with invalid sandbox calls" | ||
HOMEPAGE="https://github.com/pkgcore/pkgcheck" | ||
SLOT="0" | ||
LICENSE="BSD" | ||
|
||
src_compile() { | ||
addpredict /etc/dfs:/dev/zfs | ||
} | ||
|
||
src_test() { | ||
addwrite /dev /etc | ||
} |