Skip to content

Commit 56172db

Browse files
committed
Update _auditwall.py
1 parent 7c47781 commit 56172db

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

codeflash/verification/_auditwall.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,12 @@ def make_handler(event: str) -> Callable[[str, tuple], None]:
153153
# Block groups of events.
154154
event_prefix = event.split(".", 1)[0]
155155
if event_prefix in (
156-
"os",
157156
"fcntl",
158157
"ftplib",
159158
"glob",
160159
"imaplib",
161160
"msvcrt",
162161
"nntplib",
163-
"os",
164162
"pathlib",
165163
"poplib",
166164
"shutil",
@@ -173,6 +171,18 @@ def make_handler(event: str) -> Callable[[str, tuple], None]:
173171
"webbrowser",
174172
):
175173
return reject
174+
if event_prefix == "os" and event not in [
175+
"os.putenv",
176+
"os.unsetenv",
177+
"os.listdir",
178+
"os.scandir",
179+
"os.chdir",
180+
"os.fwalk",
181+
"os.getxattr",
182+
"os.listxattr",
183+
"os.walk",
184+
]:
185+
return reject
176186
# Allow other events.
177187
return accept
178188

0 commit comments

Comments
 (0)