Merge branches 'consdiffmgr_orig_squashed' and 'actually_compute_diffs_squashed'

This commit is contained in:
Nick Mathewson
2017-04-27 21:43:06 -04:00
11 changed files with 469 additions and 110 deletions
+16 -5
View File
@@ -89,11 +89,12 @@ storage_dir_register_with_sandbox(storage_dir_t *d, sandbox_cfg_t **cfg)
tor_asprintf(&path, "%s/%d", d->directory, idx);
tor_asprintf(&tmppath, "%s/%d.tmp", d->directory, idx);
problems += sandbox_cfg_allow_open_filename(cfg, path);
problems += sandbox_cfg_allow_open_filename(cfg, tmppath);
problems += sandbox_cfg_allow_stat_filename(cfg, path);
problems += sandbox_cfg_allow_stat_filename(cfg, tmppath);
problems += sandbox_cfg_allow_rename(cfg, tmppath, path);
problems += sandbox_cfg_allow_open_filename(cfg, tor_strdup(path));
problems += sandbox_cfg_allow_open_filename(cfg, tor_strdup(tmppath));
problems += sandbox_cfg_allow_stat_filename(cfg, tor_strdup(path));
problems += sandbox_cfg_allow_stat_filename(cfg, tor_strdup(tmppath));
problems += sandbox_cfg_allow_rename(cfg,
tor_strdup(tmppath), tor_strdup(path));
tor_free(path);
tor_free(tmppath);
@@ -529,3 +530,13 @@ storage_dir_remove_all(storage_dir_t *d)
return storage_dir_shrink(d, 0, d->max_files);
}
/**
* Return the largest number of non-temporary files we're willing to
* store in <b>d</b>.
*/
int
storage_dir_get_max_files(storage_dir_t *d)
{
return d->max_files;
}
+1
View File
@@ -45,6 +45,7 @@ int storage_dir_shrink(storage_dir_t *d,
uint64_t target_size,
int min_to_remove);
int storage_dir_remove_all(storage_dir_t *d);
int storage_dir_get_max_files(storage_dir_t *d);
#endif