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

Diff of /trunk/sandbox.c

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

Revision 90 Revision 91
525 if (NULL == realpath("/tmp", tmp_dir)) { 525 if (NULL == realpath("/tmp", tmp_dir)) {
526 perror(">>> get tmp_dir"); 526 perror(">>> get tmp_dir");
527 exit(1); 527 exit(1);
528 } 528 }
529 529
530 /* This one should not be child only, as we check above to see
531 * if we are already running (check sandbox_setup_environ).
532 * This needs to be set before calling sandbox_setup_environ(),
533 * else its not set for the child */
534 setenv(ENV_SANDBOX_ON, "1", 0);
535
530 /* Setup the environment stuff */ 536 /* Setup the child environment stuff */
531 get_sandbox_write_envvar(sandbox_write_envvar, home_dir, 537 get_sandbox_write_envvar(sandbox_write_envvar, home_dir,
532 portage_tmp_dir, var_tmp_dir, tmp_dir); 538 portage_tmp_dir, var_tmp_dir, tmp_dir);
533 get_sandbox_predict_envvar(sandbox_predict_envvar, home_dir); 539 get_sandbox_predict_envvar(sandbox_predict_envvar, home_dir);
534 sandbox_environ = sandbox_setup_environ(sandbox_dir, sandbox_lib, 540 sandbox_environ = sandbox_setup_environ(sandbox_dir, sandbox_lib,
535 sandbox_rc, sandbox_log, sandbox_debug_log, 541 sandbox_rc, sandbox_log, sandbox_debug_log,
536 sandbox_write_envvar, sandbox_predict_envvar); 542 sandbox_write_envvar, sandbox_predict_envvar);
537 if (NULL == sandbox_environ) { 543 if (NULL == sandbox_environ) {
538 perror(">>> out of memory (environ)"); 544 perror(">>> out of memory (environ)");
539 exit(1); 545 exit(1);
540 } 546 }
541
542 /* This one should not be child only, as we check above to see
543 * if we are already running (check sandbox_setup_environ) */
544 setenv(ENV_SANDBOX_ON, "1", 0);
545 547
546 /* if the portage temp dir was present, cd into it */ 548 /* if the portage temp dir was present, cd into it */
547 if (NULL != portage_tmp_dir) 549 if (NULL != portage_tmp_dir)
548 chdir(portage_tmp_dir); 550 chdir(portage_tmp_dir);
549 551

Legend:
Removed from v.90  
changed lines
  Added in v.91

  ViewVC Help
Powered by ViewVC 1.1.20