The xflock function can create a file via open() with O_CREAT, but does
not specify the create mode when it does so. I think 0644 should be
appropriate given the current usage of this function.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
struct flock fl = { readonly? F_RDLCK : F_WRLCK, SEEK_SET, 0, 0, 0 };
int fd;
- if ((fd = open(fname, readonly? O_RDONLY : (O_RDWR|O_CREAT))) < 0) {
+ if ((fd = open(fname, readonly? O_RDONLY : (O_RDWR|O_CREAT), 0644)) < 0) {
xlog(L_WARNING, "could not open %s for locking", fname);
return -1;
}