X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fbsd%2Fopenbsd%2Ftincd.c;fp=src%2Fbsd%2Fopenbsd%2Ftincd.c;h=2faf5448abdae8cf885def98934d8b7b5007d1b5;hp=0b49ea9ebbeb0136b361b3df8f32d2a15658c0de;hb=9235256116574927657a93944ef1b21e255e771b;hpb=c6a15e27d934e90a1f3a26438dddb395bdc9de19 diff --git a/src/bsd/openbsd/tincd.c b/src/bsd/openbsd/tincd.c index 0b49ea9e..2faf5448 100644 --- a/src/bsd/openbsd/tincd.c +++ b/src/bsd/openbsd/tincd.c @@ -21,12 +21,6 @@ static bool chrooted(void) { return !(confbase && *confbase); } -static void create_conf_subdir(const char *name, mode_t mode) { - char path[PATH_MAX]; - snprintf(path, sizeof(path), "%s/%s", confbase, name); - mkdir(path, mode); -} - static void open_conf_subdir(const char *name, const char *privs) { char path[PATH_MAX]; snprintf(path, sizeof(path), "%s/%s", confbase, name); @@ -37,13 +31,6 @@ static void open_common_paths(bool can_exec) { // Dummy device uses a fake path, skip it const char *dev = strcasecmp(device, DEVICE_DUMMY) ? device : NULL; - // These calls must be done before the first unveil() for two reasons: - // 1. the first unveil() blocks access to all other paths. - // 2. unveil() remembers the exact directory and won't allow access if it's (re)created. - create_conf_subdir("cache", 0777); - create_conf_subdir("hosts", 0777); - create_conf_subdir("invitations", 0700); - const unveil_path_t paths[] = { {"/dev/random", "r"}, {"/dev/urandom", "r"},