rpms/nfs-utils/devel nfs-utils-1.2.1-default-family.patch, NONE, 1.1 nfs-utils-1.2.1-mount-config.patch, NONE, 1.1 nfs-utils.spec, 1.264, 1.265
Steve Dickson
steved at fedoraproject.org
Thu Jan 21 10:57:40 UTC 2010
Author: steved
Update of /cvs/pkgs/rpms/nfs-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23276
Modified Files:
nfs-utils.spec
Added Files:
nfs-utils-1.2.1-default-family.patch
nfs-utils-1.2.1-mount-config.patch
Log Message:
- mount.nfs: Configuration file parser ignoring options
- mount.nfs: Set the default family for lookups based on
defaultproto= setting
- Enabled ipv6
nfs-utils-1.2.1-default-family.patch:
configfile.c | 12 ++++++++++++
network.c | 23 ++++++++++++-----------
2 files changed, 24 insertions(+), 11 deletions(-)
--- NEW FILE nfs-utils-1.2.1-default-family.patch ---
diff -up nfs-utils-1.2.1/utils/mount/configfile.c.orig nfs-utils-1.2.1/utils/mount/configfile.c
--- nfs-utils-1.2.1/utils/mount/configfile.c.orig 2010-01-21 05:20:04.257284410 -0500
+++ nfs-utils-1.2.1/utils/mount/configfile.c 2010-01-21 05:20:49.616131234 -0500
@@ -222,6 +222,12 @@ int inline check_vers(char *mopt, char *
unsigned long config_default_vers;
unsigned long config_default_proto;
+#ifdef IPV6_SUPPORTED
+sa_family_t config_default_family = AF_UNSPEC;
+#else
+sa_family_t config_default_family = AF_INET;
+#endif
+
/*
* Check to see if a default value is being set.
* If so, set the appropriate global value which will
@@ -243,6 +249,12 @@ int inline default_value(char *mopt)
xlog_warn("Unable to set default protocol : %s",
strerror(errno));
}
+#ifdef IPV6_SUPPORTED
+ if (!nfs_nfs_proto_family(options, &config_default_family)) {
+ xlog_warn("Unable to set default family : %s",
+ strerror(errno));
+ }
+#endif
} else {
xlog_warn("Unable to alloc memory for default protocol");
}
diff -up nfs-utils-1.2.1/utils/mount/network.c.orig nfs-utils-1.2.1/utils/mount/network.c
--- nfs-utils-1.2.1/utils/mount/network.c.orig 2010-01-21 05:20:04.252304404 -0500
+++ nfs-utils-1.2.1/utils/mount/network.c 2010-01-21 05:20:49.617183039 -0500
@@ -54,6 +54,16 @@
#include "network.h"
#include "conffile.h"
+#ifdef MOUNT_CONFIG
+extern sa_family_t config_default_family;
+#else
+#ifdef IPV6_SUPPORTED
+sa_family_t config_default_family = AF_UNSPEC;
+#else
+sa_family_t config_default_family = AF_INET;
+#endif
+#endif
+
#define PMAP_TIMEOUT (10)
#define CONNECT_TIMEOUT (20)
#define MOUNT_TIMEOUT (30)
@@ -1342,12 +1352,7 @@ int nfs_nfs_proto_family(struct mount_op
unsigned long protocol;
char *option;
-#ifdef IPV6_SUPPORTED
- *family = AF_UNSPEC;
-#else
- *family = AF_INET;
-#endif
-
+ *family = config_default_family;
switch (po_rightmost(options, nfs_transport_opttbl)) {
case 0: /* udp */
return 1;
@@ -1489,11 +1494,7 @@ int nfs_mount_proto_family(struct mount_
unsigned long protocol;
char *option;
-#ifdef HAVE_LIBTIRPC
- *family = AF_UNSPEC;
-#else
- *family = AF_INET;
-#endif
+ *family = config_default_family;
option = po_get(options, "mountproto");
if (option != NULL)
nfs-utils-1.2.1-mount-config.patch:
configfile.c | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
--- NEW FILE nfs-utils-1.2.1-mount-config.patch ---
commit d63f9e0ccb836d592593a9816ccc00a51c903328
Author: Steve Dickson <steved at redhat.com>
Date: Wed Jan 20 15:05:46 2010 -0500
mount.nfs: Configuration file parser ignoring options
When the protocol version is set on the command line,
none of the variables set in the configuration file
are passed down to the kernel due to a bug in the
parsing routine.
Tested-by: Jeff Layton <jlayton at redhat.com>
Signed-off-by: Steve Dickson <steved at redhat.com>
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index 28b722c..1dd4159 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -194,13 +194,29 @@ void free_all(void)
static char *versions[] = {"v2", "v3", "v4", "vers", "nfsvers", NULL};
int inline check_vers(char *mopt, char *field)
{
- int i;
+ int i, found=0;
- if (strncmp("mountvers", field, strlen("mountvers")) != 0) {
- for (i=0; versions[i]; i++)
- if (strcasestr(mopt, versions[i]) != NULL)
- return 1;
+ /*
+ * First check to see if the config setting is one
+ * of the many version settings
+ */
+ for (i=0; versions[i]; i++) {
+ if (strcasestr(field, versions[i]) != NULL) {
+ found++;
+ break;
+ }
}
+ if (!found)
+ return 0;
+ /*
+ * It appears the version is being set, now see
+ * if the version appears on the command
+ */
+ for (i=0; versions[i]; i++) {
+ if (strcasestr(mopt, versions[i]) != NULL)
+ return 1;
+ }
+
return 0;
}
Index: nfs-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfs-utils.spec,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -p -r1.264 -r1.265
--- nfs-utils.spec 17 Jan 2010 22:05:22 -0000 1.264
+++ nfs-utils.spec 21 Jan 2010 10:57:40 -0000 1.265
@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting cl
Name: nfs-utils
URL: http://sourceforge.net/projects/nfs
Version: 1.2.1
-Release: 12%{?dist}
+Release: 13%{?dist}
Epoch: 1
# group all 32bit related archs
@@ -21,6 +21,8 @@ Source15: nfs.sysconfig
Patch000: nfs-utils-1.2.2-rc8.patch
Patch001: nfs-utils-1.2.1-compile.patch
Patch002: nfs-utils-1.2.1-statdpath.patch
+Patch003: nfs-utils-1.2.1-mount-config.patch
+Patch004: nfs-utils-1.2.1-default-family.patch
Patch100: nfs-utils-1.2.1-statdpath-man.patch
Patch101: nfs-utils-1.2.1-exp-subtree-warn-off.patch
@@ -75,6 +77,8 @@ This package also contains the mount.nfs
%patch000 -p1
%patch001 -p1
%patch002 -p1
+%patch003 -p1
+%patch004 -p1
%patch100 -p1
%patch101 -p1
@@ -100,6 +104,7 @@ CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_F
LDFLAGS="-pie" \
--enable-mount \
--enable-mountconfig \
+ --enable-ipv6 \
--with-statdpath=/var/lib/nfs/statd
make all
@@ -250,6 +255,12 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4
%changelog
+* Thu Jan 21 2010 Steve Dickson <steved at redhat.com> 1.2.1-13
+- mount.nfs: Configuration file parser ignoring options
+- mount.nfs: Set the default family for lookups based on
+ defaultproto= setting
+- Enabled ipv6
+
* Sun Jan 17 2010 Steve Dickson <steved at redhat.com> 1.2.1-12
- Updated to latest upstream RC release: nfs-utils-1-2-2-rc7
which includes Ipv6 support for tcpwrapper (disabled by default).
More information about the scm-commits
mailing list