"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/app/main/main.c" between
tor-0.4.6.3-rc.tar.gz and tor-0.4.6.4-rc.tar.gz

About: Tor is an anonymous Internet communication system - a network of virtual tunnels that allows people and groups to improve their privacy and security on the Internet. Release candidate.

main.c  (tor-0.4.6.3-rc):main.c  (tor-0.4.6.4-rc)
skipping to change at line 855 skipping to change at line 855
// host name to sandbox // host name to sandbox
gethostname(hname, sizeof(hname)); gethostname(hname, sizeof(hname));
tor_add_addrinfo(hname); tor_add_addrinfo(hname);
} }
static sandbox_cfg_t* static sandbox_cfg_t*
sandbox_init_filter(void) sandbox_init_filter(void)
{ {
const or_options_t *options = get_options(); const or_options_t *options = get_options();
sandbox_cfg_t *cfg = sandbox_cfg_new(); sandbox_cfg_t *cfg = sandbox_cfg_new();
int i;
sandbox_cfg_allow_openat_filename(&cfg, sandbox_cfg_allow_openat_filename(&cfg,
get_cachedir_fname("cached-status")); get_cachedir_fname("cached-status"));
#define OPEN(name) \ #define OPEN(name) \
sandbox_cfg_allow_open_filename(&cfg, tor_strdup(name)) sandbox_cfg_allow_open_filename(&cfg, tor_strdup(name))
#define OPENDIR(dir) \ #define OPENDIR(dir) \
sandbox_cfg_allow_opendir_dirname(&cfg, tor_strdup(dir)) sandbox_cfg_allow_opendir_dirname(&cfg, tor_strdup(dir))
skipping to change at line 941 skipping to change at line 940
if (authdir_mode(options)) if (authdir_mode(options))
OPEN_DATADIR("approved-routers"); OPEN_DATADIR("approved-routers");
if (options->ServerDNSResolvConfFile) if (options->ServerDNSResolvConfFile)
sandbox_cfg_allow_open_filename(&cfg, sandbox_cfg_allow_open_filename(&cfg,
tor_strdup(options->ServerDNSResolvConfFile)); tor_strdup(options->ServerDNSResolvConfFile));
else else
sandbox_cfg_allow_open_filename(&cfg, tor_strdup("/etc/resolv.conf")); sandbox_cfg_allow_open_filename(&cfg, tor_strdup("/etc/resolv.conf"));
for (i = 0; i < 2; ++i) { const char *torrc_defaults_fname = get_torrc_fname(1);
if (get_torrc_fname(i)) { if (torrc_defaults_fname) {
sandbox_cfg_allow_open_filename(&cfg, tor_strdup(get_torrc_fname(i))); sandbox_cfg_allow_open_filename(&cfg, tor_strdup(torrc_defaults_fname));
} }
const char *torrc_fname = get_torrc_fname(0);
if (torrc_fname) {
sandbox_cfg_allow_open_filename(&cfg, tor_strdup(torrc_fname));
// allow torrc backup and torrc.tmp to make SAVECONF work
char *torrc_bck = NULL;
tor_asprintf(&torrc_bck, CONFIG_BACKUP_PATTERN, torrc_fname);
sandbox_cfg_allow_rename(&cfg, tor_strdup(torrc_fname), torrc_bck);
char *torrc_tmp = NULL;
tor_asprintf(&torrc_tmp, "%s.tmp", torrc_fname);
sandbox_cfg_allow_rename(&cfg, torrc_tmp, tor_strdup(torrc_fname));
sandbox_cfg_allow_open_filename(&cfg, tor_strdup(torrc_tmp));
// we need to stat the existing backup file
sandbox_cfg_allow_stat_filename(&cfg, tor_strdup(torrc_bck));
} }
SMARTLIST_FOREACH(options->FilesOpenedByIncludes, char *, f, { SMARTLIST_FOREACH(options->FilesOpenedByIncludes, char *, f, {
if (file_status(f) == FN_DIR) { if (file_status(f) == FN_DIR) {
OPENDIR(f); OPENDIR(f);
} else { } else {
OPEN(f); OPEN(f);
} }
}); });
 End of changes. 2 change blocks. 
5 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)