diff options
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/checkpath.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c index 765506de..8726dca8 100644 --- a/src/rc/checkpath.c +++ b/src/rc/checkpath.c @@ -57,7 +57,9 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode, int file) if (stat(path, &st)) { if (file) { einfo("%s: creating file", path); - if ((fd = open(path, O_CREAT)) == -1) { + if (! mode) + mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH; + if ((fd = open(path, O_CREAT, mode)) == -1) { eerror("%s: open: %s", applet, strerror(errno)); return -1; } |