]> git.ipfire.org Git - people/ms/dma.git/commitdiff
dma: create spool files mode 660
authorSimon Schubert <corecode@dragonflybsd.org>
Sun, 20 Sep 2009 18:56:32 +0000 (20:56 +0200)
committerSimon Schubert <corecode@dragonflybsd.org>
Sun, 20 Sep 2009 19:01:27 +0000 (21:01 +0200)
dma runs setgid mail, so we need to create files which are group
readable, otherwise we won't be able to read them later.

spool.c

diff --git a/spool.c b/spool.c
index 69f29f310953647b37c5d2c21e17fcbfcbdcf940..23f6e420e0231aee09250fc7c39ef89288c6fdfe 100644 (file)
--- 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);