nfs-utils/nfs-utils-o_create-mode

34 lines
1.3 KiB
Plaintext

From: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] nfs-utils: open with O_CREAT needs valid mode
This patch uses a valid mode to avoid an assertion check in STABLE.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
nfs-utils-1.1.0/support/nfs/fstab.c | 2 +-
nfs-utils-1.1.0/support/nfs/xio.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- nfs-utils-1.1.0.orig/support/nfs/fstab.c 2007-05-11 05:40:57.000000000 +0200
+++ nfs-utils-1.1.0/support/nfs/fstab.c 2008-02-13 20:49:37.689134000 +0100
@@ -342,7 +342,7 @@ lock_mtab (void) {
sprintf(linktargetfile, MOUNTLOCK_LINKTARGET, getpid ());
- i = open (linktargetfile, O_WRONLY|O_CREAT, 0);
+ i = open (linktargetfile, O_WRONLY|O_CREAT, 0600);
if (i < 0) {
int errsv = errno;
/* linktargetfile does not exist (as a file)
--- nfs-utils-1.1.0.orig/support/nfs/xio.c 2007-05-11 05:40:57.000000000 +0200
+++ nfs-utils-1.1.0/support/nfs/xio.c 2008-02-13 20:53:03.611009000 +0100
@@ -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), 0600)) < 0) {
xlog(L_WARNING, "could not open %s for locking", fname);
return -1;
}