Date: Friday, July 29, 2011 @ 17:04:18
  Author: tpowa
Revision: 133600

upgpkg: nfs-utils 1.2.4-1
bump to latest version

Added:
  nfs-utils/trunk/kernel-3.0-segfault.patch
Modified:
  nfs-utils/trunk/PKGBUILD

---------------------------+
 PKGBUILD                  |   16 +++++++------
 kernel-3.0-segfault.patch |   53 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2011-07-29 21:04:02 UTC (rev 133599)
+++ PKGBUILD    2011-07-29 21:04:18 UTC (rev 133600)
@@ -6,8 +6,8 @@
 # Contributor: Marco Lima <cipparello gmail com>
 
 pkgname=nfs-utils
-pkgver=1.2.3
-pkgrel=3
+pkgver=1.2.4
+pkgrel=1
 pkgdesc="Support programs for Network File Systems"
 arch=('i686' 'x86_64')
 url='http://nfs.sourceforge.net'
@@ -24,9 +24,10 @@
        idmapd.conf
        start-statd.patch
        nfs-utils-1.1.4-mtab-sym.patch
-       nfs-utils-1.1.4-no-exec.patch)
+       nfs-utils-1.1.4-no-exec.patch
+        kernel-3.0-segfault.patch)
 install=nfs-utils.install
-md5sums=('1131dc5f27c4f3905a6e7ee0d594fd4d'
+md5sums=('938dc0574f3eb9891a8ed4746f806277'
          'fc508e10cdf5e8ddd80373b1b2bc99a1'
          'f73f197a16b02c3e248488ec35c4cf43'
          '5ae080f6117cef3140f02bc162bdc755'
@@ -35,13 +36,14 @@
          'eb4f4027fab6fc1201f1ca04f5954c76'
          'e24f81a8c8657672e262c61235d34b4a'
          '7674106eaaa4c149bccd4f05fe3604e9'
-         '4f4827dfc93008dfadd0a530ad0872b2')
+         '4f4827dfc93008dfadd0a530ad0872b2'
+         'ab92e67f3d0ee2935faab9cdabef8003')
 
 build() {
   cd $srcdir/${pkgname}-${pkgver}
   patch -Np1 -i ../nfs-utils-1.1.4-mtab-sym.patch
-  patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch
-
+  #patch -Np1 -i ../nfs-utils-1.1.4-no-exec.patch
+  patch -Np1 -i ../kernel-3.0-segfault.patch
   # arch specific patch
   patch -Np0 -i $srcdir/start-statd.patch
 

Added: kernel-3.0-segfault.patch
===================================================================
--- kernel-3.0-segfault.patch                           (rev 0)
+++ kernel-3.0-segfault.patch   2011-07-29 21:04:18 UTC (rev 133600)
@@ -0,0 +1,53 @@
+mount.nfs segfaults if kernel version number does not contain
+at least 3 components delimited with a dot.
+
+Avoid this by matching up to three unsigned integers inialised
+to zero, separated by dots.
+
+A version that does not start with an integer is probably a future
+version where the versioning evolved to another scheme.
+Return UINT_MAX which is guaranteed to be higher than existing
+versions. This would also make it possible to easily identify
+versions that do not start with an integer.
+
+Signed-off-by: Luk Claes <luk@...>
+---
+ utils/mount/version.h |   16 +++++++++-------
+ 1 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/utils/mount/version.h b/utils/mount/version.h
+index af61a6f..531cf68 100644
+--- a/utils/mount/version.h
++++ b/utils/mount/version.h
+@@ -23,8 +23,8 @@
+ #ifndef _NFS_UTILS_MOUNT_VERSION_H
+ #define _NFS_UTILS_MOUNT_VERSION_H
+
+-#include <stdlib.h>
+-#include <string.h>
++#include <stdio.h>
++#include <limits.h>
+
+ #include <sys/utsname.h>
+
+@@ -37,14 +37,16 @@ static inline unsigned int MAKE_VERSION(unsigned int p, 
unsigned int q,
+ static inline unsigned int linux_version_code(void)
+ {
+       struct utsname my_utsname;
+-      unsigned int p, q, r;
++      unsigned int p, q = 0, r = 0;
+
++      /* UINT_MAX as backward compatibility code should not be run */
+       if (uname(&my_utsname))
+-              return 0;
++              return UINT_MAX;
+
+-      p = (unsigned int)atoi(strtok(my_utsname.release, "."));
+-      q = (unsigned int)atoi(strtok(NULL, "."));
+-      r = (unsigned int)atoi(strtok(NULL, "."));
++      /* UINT_MAX as future versions might not start with an integer */
++      if (sscanf(my_utsname.release, "%u.%u.%u", &p, &q, &r) < 1)
++              return UINT_MAX;
++      
+       return MAKE_VERSION(p, q, r);
+ }

Reply via email to