From: Lennart Poettering Date: Wed, 16 Mar 2011 01:58:05 +0000 (+0100) Subject: util: make touched files non-writable by default X-Git-Tag: v21~70 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=14f3c8252b4dd73bff778b5af9f872e929bd566c util: make touched files non-writable by default --- diff --git a/src/util.c b/src/util.c index eefd66e8c..c9c88927b 100644 --- a/src/util.c +++ b/src/util.c @@ -3524,7 +3524,7 @@ int touch(const char *path) { assert(path); - if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666)) < 0) + if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0644)) < 0) return -errno; close_nointr_nofail(fd);