File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ def __init__(self, sandbox=False):
2828 os .system (f"chown -R { self .user } :root { self .sandbox_path } " )
2929 self .banned_keywords = CONFIG .get ("SANDBOX_PYTHON_BANNED_KEYWORDS" , 'nothing_is_banned' ).split (',' );
3030 try :
31+ banned_hosts_file_path = f'{ self .sandbox_path } /.SANDBOX_BANNED_HOSTS'
32+ if os .path .exists (banned_hosts_file_path ):
33+ os .remove (banned_hosts_file_path )
3134 banned_hosts = CONFIG .get ("SANDBOX_PYTHON_BANNED_HOSTS" , '' ).strip ()
3235 if banned_hosts :
3336 hostname = socket .gethostname ()
3437 local_ip = socket .gethostbyname (hostname )
3538 banned_hosts = f"{ banned_hosts } ,{ hostname } ,{ local_ip } "
36- banned_hosts_file_path = f'{ self .sandbox_path } /.SANDBOX_BANNED_HOSTS'
37- if os .path .exists (banned_hosts_file_path ):
38- os .remove (banned_hosts_file_path )
3939 with open (banned_hosts_file_path , "w" ) as f :
4040 f .write (banned_hosts )
4141 os .chmod (banned_hosts_file_path , 0o644 )
You can’t perform that action at this time.
0 commit comments