diff options
author | Jeff Layton <jlayton@redhat.com> | 2007-08-07 08:01:08 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-08-09 13:26:42 +1000 |
commit | ff82d8688cd096f3983532e8aa5cbfe46780d45a (patch) | |
tree | 31bbac46f7e7c1f575c69762b9151d97d6af79c7 /support/nfs/xio.c | |
parent | fa0a9b564d895a2b3cff85b976baad6dcb7d7d2c (diff) | |
download | nfs-utils-ff82d8688cd096f3983532e8aa5cbfe46780d45a.tar.gz nfs-utils-ff82d8688cd096f3983532e8aa5cbfe46780d45a.tar.xz nfs-utils-ff82d8688cd096f3983532e8aa5cbfe46780d45a.zip |
nfs-utils: specify a create mode with open(...O_CREAT) call in xflock
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>
Diffstat (limited to 'support/nfs/xio.c')
-rw-r--r-- | support/nfs/xio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/support/nfs/xio.c b/support/nfs/xio.c index 221cce6..0453ca7 100644 --- a/support/nfs/xio.c +++ b/support/nfs/xio.c @@ -57,7 +57,7 @@ xflock(char *fname, char *type) 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; } |