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

Diff of /trunk/src/libsandbox.c

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

Revision 262 Revision 263
1443 char *resolved_path = NULL; 1443 char *resolved_path = NULL;
1444 char *log_path = NULL, *debug_log_path = NULL; 1444 char *log_path = NULL, *debug_log_path = NULL;
1445 int old_errno = errno; 1445 int old_errno = errno;
1446 int result = 1; 1446 int result = 1;
1447 int access = 0, debug = 0, verbose = 1; 1447 int access = 0, debug = 0, verbose = 1;
1448 int color = ((getenv("NOCOLOR") != NULL) ? 0 : 1); 1448 int color = ((is_env_on(ENV_NOCOLOR)) ? 0 : 1);
1449 1449
1450 absolute_path = resolve_path(file, 0); 1450 absolute_path = resolve_path(file, 0);
1451 if (NULL == absolute_path) 1451 if (NULL == absolute_path)
1452 goto error; 1452 goto error;
1453 resolved_path = resolve_path(file, 1); 1453 resolved_path = resolve_path(file, 1);
1454 if (NULL == resolved_path) 1454 if (NULL == resolved_path)
1455 goto error; 1455 goto error;
1456 1456
1457 log_path = getenv(ENV_SANDBOX_LOG); 1457 log_path = getenv(ENV_SANDBOX_LOG);
1458 if (NULL != getenv(ENV_SANDBOX_DEBUG)) { 1458 if (is_env_on(ENV_SANDBOX_DEBUG)) {
1459 if ((0 == strncasecmp(getenv(ENV_SANDBOX_DEBUG), "1", 1)) ||
1460 (0 == strncasecmp(getenv(ENV_SANDBOX_DEBUG), "yes", 3))) {
1461 debug_log_path = getenv(ENV_SANDBOX_DEBUG_LOG); 1459 debug_log_path = getenv(ENV_SANDBOX_DEBUG_LOG);
1462 debug = 1; 1460 debug = 1;
1463 } 1461 }
1464 }
1465 1462
1466 if (NULL != getenv(ENV_SANDBOX_VERBOSE)) { 1463 if (is_env_off(ENV_SANDBOX_VERBOSE)) {
1467 if ((0 == strncasecmp(getenv(ENV_SANDBOX_VERBOSE), "0", 1)) ||
1468 (0 == strncasecmp(getenv(ENV_SANDBOX_VERBOSE), "no", 2)))
1469 verbose = 0; 1464 verbose = 0;
1470 } 1465 }
1471 1466
1472 result = check_access(sbcontext, func, absolute_path, resolved_path); 1467 result = check_access(sbcontext, func, absolute_path, resolved_path);
1473 1468
1474 if (1 == verbose) { 1469 if (1 == verbose) {

Legend:
Removed from v.262  
changed lines
  Added in v.263

  ViewVC Help
Powered by ViewVC 1.1.20