From f47a0d9ea0a5392417ae463634129354e28092d4 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 4 Mar 2016 12:15:18 +0100 Subject: sfeed_frames: use S_IR* names (portability), respect umask use 0777 and 0666 permissions, it will respect the process umask (generally 0022), so 0755 and 0644 effectively. --- sfeed_frames.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sfeed_frames.c b/sfeed_frames.c index 06d2c0d..ad21e5e 100644 --- a/sfeed_frames.c +++ b/sfeed_frames.c @@ -153,8 +153,9 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) parsedtime = 0; strtotime(fields[FieldUnixTimestamp], &parsedtime); - /* content file doesn't exist yet and has write access */ - if ((fd = open(filepath, O_CREAT | O_EXCL | O_WRONLY, 0644)) == -1) { + /* content file doesn't exist yet and has error? */ + if ((fd = open(filepath, O_CREAT | O_EXCL | O_WRONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) == -1) { if (errno != EEXIST) err(1, "open: %s", filepath); } else { -- cgit v1.2.3