Make sure the open() system calling in exportfs uses mode bits when
creating the etab file.
This commit is contained in:
parent
a24ef7b46a
commit
1702f2ca74
26
nfs-utils-1.1.0-exportfs-open.patch
Normal file
26
nfs-utils-1.1.0-exportfs-open.patch
Normal file
@ -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);
|
@ -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 <steved@redhat.com> 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 <steved@redhat.com> 1.1.0-3
|
||||
- Added nosharecache mount option which re-enables
|
||||
rw/ro mounts to the same server (bz 243913).
|
||||
|
Loading…
Reference in New Issue
Block a user