File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2121#include <dlfcn.h>
2222
2323#define CONFIG_FILE ".sandbox.conf"
24+ #define KEY_BANNED_HOSTS "SANDBOX_PYTHON_BANNED_HOSTS"
25+ #define KEY_ALLOW_SUBPROCESS "SANDBOX_PYTHON_ALLOW_SUBPROCESS"
2426
2527static char * banned_hosts = NULL ;
2628static int allow_subprocess = 0 ; // 默认禁止
@@ -57,10 +59,10 @@ static void load_sandbox_config() {
5759 while (* value == ' ' || * value == '\t' ) value ++ ;
5860 char * vend = value + strlen (value ) - 1 ;
5961 while (vend > value && (* vend == ' ' || * vend == '\t' )) * vend -- = '\0' ;
60- if (strcmp (key , "SANDBOX_PYTHON_BANNED_HOSTS" ) == 0 ) {
62+ if (strcmp (key , KEY_BANNED_HOSTS ) == 0 ) {
6163 free (banned_hosts );
6264 banned_hosts = strdup (value );
63- } else if (strcmp (key , "SANDBOX_PYTHON_ALLOW_SUBPROCESS" ) == 0 ) {
65+ } else if (strcmp (key , KEY_ALLOW_SUBPROCESS ) == 0 ) {
6466 allow_subprocess = atoi (value );
6567 }
6668 }
You can’t perform that action at this time.
0 commit comments