open should use 3 args when using O_CREAT.
This commit is contained in:
parent
bf8f0da921
commit
4f2bb5ceaf
@ -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 (stat(path, &st)) {
|
||||||
if (file) {
|
if (file) {
|
||||||
einfo("%s: creating file", path);
|
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));
|
eerror("%s: open: %s", applet, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user