summaryrefslogtreecommitdiff
path: root/sfeed_frames.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-03-04 12:15:18 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-03-04 12:15:18 +0100
commitf47a0d9ea0a5392417ae463634129354e28092d4 (patch)
tree664503deedcbec5606594a22fcad2468f725c9c9 /sfeed_frames.c
parentfc51ac87a52f859af5084e1abf3ab7d346f0cc20 (diff)
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.
Diffstat (limited to 'sfeed_frames.c')
-rw-r--r--sfeed_frames.c5
1 files 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 {