blob: 1178f8ac02bd84e13d3368ca96808a5b3dc059fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
/*
* get_sandbox_conf.c
*
* Util functions.
*
* Copyright 1999-2008 Gentoo Foundation
* Licensed under the GPL-2
*/
#include "headers.h"
#include "sbutil.h"
/* Where the file exists in our source tree */
#define LOCAL_SANDBOX_CONF_FILE "/etc/sandbox.conf"
char *get_sandbox_conf(void)
{
char *ret = SANDBOX_CONF_FILE;
save_errno();
if (is_env_on(ENV_SANDBOX_TESTING)) {
char *abs = getenv("abs_top_srcdir");
sb_assert(abs != NULL);
ret = xmalloc(strlen(abs) + strlen(LOCAL_SANDBOX_CONF_FILE) + 1);
sprintf(ret, "%s%s", abs, LOCAL_SANDBOX_CONF_FILE);
}
restore_errno();
return ret;
}
|