/[path-sandbox]/trunk/src/sandbox.c
Gentoo

Diff of /trunk/src/sandbox.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 70 Revision 71
667 } 667 }
668 668
669 setenv(ENV_SANDBOX_DIR, sandbox_dir, 1); 669 setenv(ENV_SANDBOX_DIR, sandbox_dir, 1);
670 setenv(ENV_SANDBOX_LIB, sandbox_lib, 1); 670 setenv(ENV_SANDBOX_LIB, sandbox_lib, 1);
671 setenv(ENV_SANDBOX_BASHRC, sandbox_rc, 1); 671 setenv(ENV_SANDBOX_BASHRC, sandbox_rc, 1);
672 if (NULL != getenv("LD_PRELOAD")) {
673 tmp_string = malloc(strlen(getenv("LD_PRELOAD")) +
674 strlen(sandbox_lib) + 2);
675 if (NULL == tmp_string) {
676 perror(">>> Out of memory (LD_PRELOAD)");
677 exit(1);
678 }
679 strncpy(tmp_string, sandbox_lib, sizeof(sandbox_lib));
680 strncat(tmp_string, " ", 1);
681 strncat(tmp_string, getenv("LD_PRELOAD"), strlen(getenv("LD_PRELOAD")));
682 setenv("LD_PRELOAD", tmp_string, 1);
683 free(tmp_string);
684 } else {
672 setenv("LD_PRELOAD", sandbox_lib, 1); 685 setenv("LD_PRELOAD", sandbox_lib, 1);
686 }
673 687
674 if (!getenv(ENV_SANDBOX_DENY)) 688 if (!getenv(ENV_SANDBOX_DENY))
675 setenv(ENV_SANDBOX_DENY, LD_PRELOAD_FILE, 1); 689 setenv(ENV_SANDBOX_DENY, LD_PRELOAD_FILE, 1);
676 690
677 if (!getenv(ENV_SANDBOX_READ)) 691 if (!getenv(ENV_SANDBOX_READ))

Legend:
Removed from v.70  
changed lines
  Added in v.71

  ViewVC Help
Powered by ViewVC 1.1.20