aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-06-17 15:14:33 +0000
committerRoy Marples <roy@marples.name>2008-06-17 15:14:33 +0000
commit4f2bb5ceafbc09d0c2dea4ee91ddf7d6052e65b3 (patch)
tree7ae5a5318cf93684ee9d41827ec7549b539cb443 /src
parentbf8f0da92154f3295c7a84227294e776d179a2ad (diff)
open should use 3 args when using O_CREAT.
Diffstat (limited to 'src')
-rw-r--r--src/rc/checkpath.c4
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;
}