summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2021-06-28 21:05:17 +0200
committerSander Vrijders <sander@ouroboros.rocks>2021-06-29 08:55:56 +0200
commit16675c72764c59644c1822bf481482fcbd6e850c (patch)
treee496bcccd96b8e45e57a739357f9965c9d016cf6
parent9d2688340bea357e2c2206f3c69ea64c866cb2ad (diff)
downloadouroboros-16675c72764c59644c1822bf481482fcbd6e850c.zip
ouroboros-16675c72764c59644c1822bf481482fcbd6e850c.tar.gz
irmd: Fix setting mode on RIB directory
The irmd was creating the directory with the wrong mode set because the default mask (022) was not cleared. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/irmd/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 471e9c3..8ca0a1d 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -2292,6 +2292,7 @@ static int irm_init(void)
{
struct stat st;
pthread_condattr_t cattr;
+ mode_t mask;
memset(&st, 0, sizeof(st));
@@ -2393,10 +2394,14 @@ static int irm_init(void)
goto fail_rdrbuff;
}
#ifdef HAVE_FUSE
+ mask = umask(0);
+
if (stat(FUSE_PREFIX, &st) != -1)
log_warn(FUSE_PREFIX " already exists...");
else
mkdir(FUSE_PREFIX, 0777);
+
+ umask(mask);
#endif
#ifdef HAVE_LIBGCRYPT