about summary refs log tree commit diff
path: root/mdeliver.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2019-02-03 17:17:32 +0100
committerLeah Neukirchen <leah@vuxu.org>2019-02-03 17:17:32 +0100
commit6645e80324bd259a2d3b3b372f472bfa05fd51a6 (patch)
treef4818b8e00cc380771e2a4149ab4a4717acab923 /mdeliver.c
parent5a2c6747b69a312e350b658b4446f845f70b671d (diff)
downloadmblaze-6645e80324bd259a2d3b3b372f472bfa05fd51a6.tar.gz
mblaze-6645e80324bd259a2d3b3b372f472bfa05fd51a6.tar.xz
mblaze-6645e80324bd259a2d3b3b372f472bfa05fd51a6.zip
mdeliver: force mode 0600 for pipes (BSD gives 0000 here by default)
Diffstat (limited to 'mdeliver.c')
-rw-r--r--mdeliver.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdeliver.c b/mdeliver.c
index 41d1e01..cbded45 100644
--- a/mdeliver.c
+++ b/mdeliver.c
@@ -88,6 +88,8 @@ tryagain:
 		struct stat st;
 		if (fstat(fileno(infile), &st) < 0)
 			st.st_mode = 0600;
+		if (S_ISFIFO(st.st_mode))
+			st.st_mode = 0600;
 		outfd = open(tmp, O_CREAT | O_WRONLY | O_EXCL,
 		    st.st_mode & 07777);
 		if (outfd < 0) {