We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7d3912 commit ae70a44Copy full SHA for ae70a44
aikido_zen/sinks/os.py
@@ -1,7 +1,7 @@
1
"""
2
Sink module for python's `os`
3
4
-
+import os
5
from pathlib import PurePath
6
import aikido_zen.vulnerabilities as vulns
7
from aikido_zen.helpers.register_call import register_call
@@ -37,7 +37,6 @@ def patch(m):
37
# os.*(...) patches
38
patch_function(m, "access", _os_patch)
39
patch_function(m, "chmod", _os_patch)
40
- patch_function(m, "chown", _os_patch)
41
patch_function(m, "mkdir", _os_patch)
42
patch_function(m, "listdir", _os_patch)
43
patch_function(m, "readlink", _os_patch)
@@ -50,6 +49,10 @@ def patch(m):
50
49
patch_function(m, "walk", _os_patch)
51
patch_function(m, "open", _os_patch)
52
+ # `chown` patch is platform-specific, so don't patch on windows
53
+ if hasattr(os, "chown"):
54
+ patch_function(m, "chown", _os_patch)
55
+
56
# os.path.*(...) patches
57
patch_function(m, "path.getsize", _os_patch)
58
patch_function(m, "path.join", _os_patch)
0 commit comments