From: Simon Schubert Date: Sun, 20 Sep 2009 18:56:32 +0000 (+0200) Subject: dma: create spool files mode 660 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bd3531e9dde746fbd7a8e9c1cce397a0dfae573;p=people%2Fms%2Fdma.git dma: create spool files mode 660 dma runs setgid mail, so we need to create files which are group readable, otherwise we won't be able to read them later. --- diff --git a/spool.c b/spool.c index 69f29f3..23f6e42 100644 --- a/spool.c +++ b/spool.c @@ -78,6 +78,9 @@ newspoolf(struct queue *queue) fd = mkstemp(fn); if (fd < 0) return (-1); + /* XXX group rights */ + if (fchmod(fd, 0660) < 0) + goto fail; if (flock(fd, LOCK_EX) == -1) goto fail; queue->tmpf = strdup(fn);