--- /dev/null
+ o Minor bugfixes (seccomp sandbox):
+ - Avoid warnings when running with sandboxing enabled at the same
+ time as cookie authentication, hidden services or directory
+ authority voting. Fixes part of 12064; bugfix on 0.2.5.1-alpha.
+
);
{
- smartlist_t *logfiles = smartlist_new();
- tor_log_get_logfile_names(logfiles);
- SMARTLIST_FOREACH(logfiles, char *, logfile_name, {
+ smartlist_t *files = smartlist_new();
+ tor_log_get_logfile_names(files);
+ rend_services_add_filenames_to_list(files);
+ SMARTLIST_FOREACH(files, char *, file_name, {
/* steals reference */
- sandbox_cfg_allow_open_filename(&cfg, logfile_name);
+ sandbox_cfg_allow_open_filename(&cfg, file_name);
});
- smartlist_free(logfiles);
+ smartlist_free(files);
}
{
return 0;
}
+/** Add to <b>lst</b> every filename used by <b>s</b>. */
+static void
+rend_service_add_filenames_to_list(smartlist_t *lst, const rend_service_t *s)
+{
+ tor_assert(lst);
+ tor_assert(s);
+ smartlist_add_asprintf(lst, "%s"PATH_SEPARATOR"private_key",
+ s->directory);
+ smartlist_add_asprintf(lst, "%s"PATH_SEPARATOR"hostname",
+ s->directory);
+ smartlist_add_asprintf(lst, "%s"PATH_SEPARATOR"client_keys",
+ s->directory);
+}
+
+/** Add to <b>lst</b> every filename used by a configured hidden service */
+void
+rend_services_add_filenames_to_list(smartlist_t *lst)
+{
+ if (!rend_service_list)
+ return;
+ SMARTLIST_FOREACH_BEGIN(rend_service_list, rend_service_t *, s) {
+ rend_service_add_filenames_to_list(lst, s);
+ } SMARTLIST_FOREACH_END(s);
+}
+
/** Load and/or generate private keys for the hidden service <b>s</b>,
* possibly including keys for client authorization. Return 0 on success, -1
* on failure. */
int num_rend_services(void);
int rend_config_services(const or_options_t *options, int validate_only);
int rend_service_load_all_keys(void);
+void rend_services_add_filenames_to_list(smartlist_t *lst);
void rend_services_introduce(void);
void rend_consider_services_upload(time_t now);
void rend_hsdir_routers_changed(void);