aboutgitcodebugslistschat
path: root/passt.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-04-13 22:09:37 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-04-13 22:37:40 +0200
commit0abec0eb60b99efc6bf03ddba2389d3640629c19 (patch)
tree0d7226bc8dc90960d90df42911436e967c9f1035 /passt.c
parent4aa8e54a303dfde9a53c47cd07c5af3c5fad4f01 (diff)
downloadpasst-0abec0eb60b99efc6bf03ddba2389d3640629c19.tar
passt-0abec0eb60b99efc6bf03ddba2389d3640629c19.tar.gz
passt-0abec0eb60b99efc6bf03ddba2389d3640629c19.tar.bz2
passt-0abec0eb60b99efc6bf03ddba2389d3640629c19.tar.lz
passt-0abec0eb60b99efc6bf03ddba2389d3640629c19.tar.xz
passt-0abec0eb60b99efc6bf03ddba2389d3640629c19.tar.zst
passt-0abec0eb60b99efc6bf03ddba2389d3640629c19.zip
passt: Make UNIX domain socket world-writable and world-readable
...save a chmod every time passt is started. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'passt.c')
-rw-r--r--passt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/passt.c b/passt.c
index ed8b251..2fe57bc 100644
--- a/passt.c
+++ b/passt.c
@@ -42,6 +42,7 @@
#include <linux/rtnetlink.h>
#include <time.h>
#include <syslog.h>
+#include <sys/stat.h>
#include "passt.h"
#include "arp.h"
@@ -80,6 +81,10 @@ static int sock_unix(void)
perror("UNIX socket bind");
exit(EXIT_FAILURE);
}
+
+ chmod(UNIX_SOCK_PATH,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+
return fd;
}