Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions aikido_zen/sinks/os.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Sink module for python's `os`
"""

import os
from pathlib import PurePath
import aikido_zen.vulnerabilities as vulns
from aikido_zen.helpers.register_call import register_call
Expand Down Expand Up @@ -37,7 +37,6 @@ def patch(m):
# os.*(...) patches
patch_function(m, "access", _os_patch)
patch_function(m, "chmod", _os_patch)
patch_function(m, "chown", _os_patch)
patch_function(m, "mkdir", _os_patch)
patch_function(m, "listdir", _os_patch)
patch_function(m, "readlink", _os_patch)
Expand All @@ -50,6 +49,10 @@ def patch(m):
patch_function(m, "walk", _os_patch)
patch_function(m, "open", _os_patch)

# `chown` patch is platform-specific, so don't patch on windows
if hasattr(os, "chown"):
patch_function(m, "chown", _os_patch)

# os.path.*(...) patches
patch_function(m, "path.getsize", _os_patch)
patch_function(m, "path.join", _os_patch)
Expand Down
Loading