File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -496,11 +496,17 @@ long syscall(long number, ...) {
496496 case SYS_setgid :
497497 case SYS_reboot :
498498 case SYS_mount :
499+ #ifdef SYS_chown
499500 case SYS_chown :
501+ #endif
502+ #ifdef SYS_chmod
500503 case SYS_chmod :
504+ #endif
501505 case SYS_fchmodat :
502506 case SYS_mprotect :
507+ #ifdef SYS_open
503508 case SYS_open :
509+ #endif
504510 case SYS_openat :
505511 case SYS_swapon :
506512 case SYS_swapoff :
@@ -525,6 +531,7 @@ long syscall(long number, ...) {
525531 * 限制加载动态链接库
526532 */
527533static int dl_path_allowed (const char * filename ) {
534+ if (!filename || !* filename ) return 1 ;
528535 if (!dl_path_containment || !* dl_path_containment ) return 0 ;
529536 char * rules = strdup (dl_path_containment );
530537 if (!rules ) return 0 ;
@@ -544,7 +551,7 @@ static int dl_path_allowed(const char *filename) {
544551void * dlopen (const char * filename , int flag ) {
545552 RESOLVE_REAL (dlopen );
546553 ensure_config_loaded ();
547- if (is_sandbox_user () && filename && !dl_path_allowed (filename )) {
554+ if (is_sandbox_user () && !dl_path_allowed (filename )) {
548555 fprintf (stderr , "Permission denied to access file %s.\n" , filename );
549556 errno = EACCES ;
550557 _exit (126 );
You can’t perform that action at this time.
0 commit comments