From f6952bdceac56e140e5004e7f00ff29fd8d290ca Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Wed, 29 Feb 2012 10:51:56 +0800 Subject: [PATCH] * Wed Feb 29 2012 Ian Kent - 1:5.0.6-14 - fix function to check mount.nfs version. --- ...-function-to-check-mount_nfs-version.patch | 52 +++++++++++++++++++ autofs.spec | 10 ++-- 2 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch diff --git a/autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch b/autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch new file mode 100644 index 0000000..4246df3 --- /dev/null +++ b/autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch @@ -0,0 +1,52 @@ +autofs-5.0.6 - fix function to check mount.nfs version + +From: Leonardo Chiquitto + +The function check_nfs_mount_version() compares the version +of mount.nfs to decide whether a feature is available or not. + +There's a bug in the version comparison code that causes +1.3.0 to be considered less than 1.1.1. This patch fixes it. +--- + + CHANGELOG | 1 + + lib/mounts.c | 17 +++++------------ + 2 files changed, 6 insertions(+), 12 deletions(-) + + +--- autofs-5.0.6.orig/CHANGELOG ++++ autofs-5.0.6/CHANGELOG +@@ -31,6 +31,7 @@ + - catch EHOSTUNREACH and bail out early. + - systemd support fixes. + - check scandir() return value. ++- fix function to check mount.nfs version. + + 28/06/2011 autofs-5.0.6 + ----------------------- +--- autofs-5.0.6.orig/lib/mounts.c ++++ autofs-5.0.6/lib/mounts.c +@@ -249,18 +249,11 @@ int check_nfs_mount_version(struct nfs_m + } + + if (ret) { +- if (vers->major == check->major && +- vers->minor == check->minor && +- vers->fix == check->fix) +- ; +- else { +- if (vers->major < check->major) +- ret = 0; +- else if (vers->minor < check->minor) +- ret = 0; +- else if (vers->fix < check->fix) +- ret = 0; +- } ++ if ((vers->major < check->major) || ++ ((vers->major == check->major) && (vers->minor < check->minor)) || ++ ((vers->major == check->major) && (vers->minor == check->minor) && ++ (vers->fix < check->fix))) ++ ret = 0; + } + + if (waitpid(f, &status, 0) != f) ; diff --git a/autofs.spec b/autofs.spec index 02c27b9..3960814 100644 --- a/autofs.spec +++ b/autofs.spec @@ -8,7 +8,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.6 -Release: 13%{?dist} +Release: 14%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -47,6 +47,7 @@ Patch31: autofs-5.0.6-rework-error-return-handling-in-rpc-code.patch Patch32: autofs-5.0.6-catch-EHOSTUNREACH-and-bail-out-early.patch Patch33: autofs-5.0.6-systemd-support-fixes.patch Patch34: autofs-5.0.6-fix-segmentation-fault-in-do-remount-indirect.patch +Patch35: autofs-5.0.6-fix-function-to-check-mount_nfs-version.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_systemd} BuildRequires: systemd-units @@ -136,6 +137,7 @@ echo %{version}-%{release} > .version %patch32 -p1 %patch33 -p1 %patch34 -p1 +%patch35 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -238,6 +240,9 @@ fi %dir /etc/auto.master.d %changelog +* Wed Feb 29 2012 Ian Kent - 1:5.0.6-14 +- fix function to check mount.nfs version. + * Sun Feb 26 2012 Ian Kent - 1:5.0.6-13 - fix error in %post scriplet. @@ -251,8 +256,7 @@ fi - systemd support fixes. - fix segmentation fault in do_remount_indirect(). - -* Thu Feb 9 2012 Ian Kent - 1:5.0.6-11 +* Thu Feb 9 2012 Ian Kent - 1:5.0.6-11 - fix fuzz in CHANGELOG hunk when applying patch26. * Tue Feb 7 2012 Ian Kent - 1:5.0.6-10