summaryrefslogtreecommitdiff
path: root/testing/nfs-utils/kernel-3.0-segfault.patch
diff options
context:
space:
mode:
authorNicolas Reynolds <fauno@kiwwwi.com.ar>2011-10-07 17:33:04 -0300
committerNicolas Reynolds <fauno@kiwwwi.com.ar>2011-10-07 17:33:04 -0300
commit2302f1d28510fadb2dcfa119f28ed28f164845bf (patch)
treee7040e1c743f46bc60a7844275516e4404f6ac30 /testing/nfs-utils/kernel-3.0-segfault.patch
parent2a9d1292ab60e8a2356fb3eeb36b8c3cfc22759b (diff)
parent5442e9b8f357932ed5d6cb46e90fcbf6f453469f (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: community/fotoxx/PKGBUILD community/gtkdialog/PKGBUILD community/hubbub/PKGBUILD community/libgdamm/PKGBUILD community/libparserutils/PKGBUILD community/mingw32-binutils/PKGBUILD community/mingw32-gcc-base/PKGBUILD community/mingw32-gcc/PKGBUILD community/mtpaint/PKGBUILD community/netsurf/PKGBUILD community/patchage/PKGBUILD community/qgo/PKGBUILD community/tomoyo-tools/PKGBUILD community/tre/PKGBUILD community/virtualbox/PKGBUILD core/net-tools/PKGBUILD core/openldap/PKGBUILD extra/epiphany/PKGBUILD extra/evince/PKGBUILD extra/evolution-data-server/PKGBUILD extra/evolution/PKGBUILD extra/exiv2/PKGBUILD extra/folks/PKGBUILD extra/gimp-ufraw/PKGBUILD extra/gnome-control-center/PKGBUILD extra/gnome-power-manager/PKGBUILD extra/gnome-python-desktop/PKGBUILD extra/gnome-python-extras/PKGBUILD extra/gvfs/PKGBUILD extra/jack/PKGBUILD extra/kdelibs/PKGBUILD extra/kdepim/PKGBUILD extra/koffice/PKGBUILD extra/libreoffice/PKGBUILD extra/libwebkit/PKGBUILD extra/mutter/PKGBUILD extra/nautilus/PKGBUILD extra/openmpi/PKGBUILD extra/pavucontrol/PKGBUILD extra/php/PKGBUILD extra/pidgin/PKGBUILD extra/postgresql/PKGBUILD extra/pulseaudio/PKGBUILD extra/pygobject2/PKGBUILD extra/swt/PKGBUILD extra/tomcat/PKGBUILD extra/totem/PKGBUILD extra/vigra/PKGBUILD extra/vte/PKGBUILD extra/xulrunner/PKGBUILD kde-unstable/calligra/PKGBUILD kde-unstable/kdebase-workspace/PKGBUILD multilib/lib32-atk/PKGBUILD multilib/lib32-gdk-pixbuf2/PKGBUILD multilib/lib32-glew/PKGBUILD multilib/lib32-glib2/PKGBUILD multilib/lib32-jack/PKGBUILD multilib/lib32-libpulse/PKGBUILD multilib/lib32-pango/PKGBUILD multilib/wine/PKGBUILD social/miniupnpc/PKGBUILD testing/icedtea-web-java7/PKGBUILD testing/sqlite3/PKGBUILD ~xihh/abiword/PKGBUILD
Diffstat (limited to 'testing/nfs-utils/kernel-3.0-segfault.patch')
-rw-r--r--testing/nfs-utils/kernel-3.0-segfault.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/nfs-utils/kernel-3.0-segfault.patch b/testing/nfs-utils/kernel-3.0-segfault.patch
new file mode 100644
index 000000000..3dba94a05
--- /dev/null
+++ b/testing/nfs-utils/kernel-3.0-segfault.patch
@@ -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);
+ }