From 1702f2ca744b5a9a80c318141496dc062076c596 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Thu, 16 Aug 2007 02:44:53 +0000 Subject: [PATCH] Make sure the open() system calling in exportfs uses mode bits when creating the etab file. --- nfs-utils-1.1.0-exportfs-open.patch | 26 ++++++++++++++++++++++++++ nfs-utils.spec | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 nfs-utils-1.1.0-exportfs-open.patch diff --git a/nfs-utils-1.1.0-exportfs-open.patch b/nfs-utils-1.1.0-exportfs-open.patch new file mode 100644 index 0000000..c214049 --- /dev/null +++ b/nfs-utils-1.1.0-exportfs-open.patch @@ -0,0 +1,26 @@ +diff -up nfs-utils-1.1.0/support/nfs/xio.c.orig nfs-utils-1.1.0/support/nfs/xio.c +--- nfs-utils-1.1.0/support/nfs/xio.c.orig 2007-05-10 23:40:57.000000000 -0400 ++++ nfs-utils-1.1.0/support/nfs/xio.c 2007-08-15 22:23:13.000000000 -0400 +@@ -54,13 +54,20 @@ xflock(char *fname, char *type) + { + struct sigaction sa, oldsa; + int readonly = !strcmp(type, "r"); ++ mode_t mode = (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); + 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) { +- xlog(L_WARNING, "could not open %s for locking", fname); ++ if (readonly) ++ fd = open(fname, O_RDONLY); ++ else ++ fd = open(fname, (O_RDWR|O_CREAT), mode); ++ if (fd < 0) { ++ xlog(L_WARNING, "could not %s %s for locking", ++ (readonly ? "open" : "create"), fname); + return -1; + } ++ + sa.sa_handler = doalarm; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); diff --git a/nfs-utils.spec b/nfs-utils.spec index 912a496..b8f28db 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -32,6 +32,7 @@ Patch06: nfs-utils-1.1.0-exp-subtree-warn-off.patch Patch07: nfs-utils-1.1.0-showmount-rpcerror.patch Patch08: nfs-utils-1.1.0-mount-v4-errors.patch Patch09: nfs-utils-1.1.0-mount-nosharecache.patch +Patch10: nfs-utils-1.1.0-exportfs-open.patch %if %{enablefscache} Patch90: nfs-utils-1.1.0-mount-fsc.patch @@ -94,6 +95,7 @@ This package also contains the mount.nfs and umount.nfs program. %patch07 -p1 %patch08 -p1 %patch09 -p1 +%patch10 -p1 %if %{enablefscache} %patch90 -p1 @@ -264,6 +266,10 @@ fi %attr(4755,root,root) /sbin/umount.nfs4 %changelog +* Wed Aug 15 2007 Steve Dickson 1.1.0-4 +- Make sure the open() system calling in exportfs uses + mode bits when creating the etab file. + * Mon Aug 13 2007 Steve Dickson 1.1.0-3 - Added nosharecache mount option which re-enables rw/ro mounts to the same server (bz 243913).