diff --git a/util-linux-swapon-canonicalize-swap-device.patch b/util-linux-swapon-canonicalize-swap-device.patch new file mode 100644 index 0000000..435a540 --- /dev/null +++ b/util-linux-swapon-canonicalize-swap-device.patch @@ -0,0 +1,41 @@ +Index: util-linux-ng-2.18/mount/swapon.c +=================================================================== +--- util-linux-ng-2.18.orig/mount/swapon.c ++++ util-linux-ng-2.18/mount/swapon.c +@@ -23,6 +23,7 @@ + #include "pathnames.h" + #include "swapheader.h" + #include "mangle.h" ++#include "canonicalize.h" + + #define PATH_MKSWAP "/sbin/mkswap" + +@@ -171,7 +172,11 @@ read_proc_swaps(void) { + break; + swapFiles = q; + +- swapFiles[numSwaps++] = unmangle(line); ++ if ((p = unmangle(line)) == NULL) ++ break; ++ ++ swapFiles[numSwaps++] = canonicalize_path(p); ++ free(p); + } + fclose(swaps); + } +@@ -179,10 +184,14 @@ read_proc_swaps(void) { + static int + is_in_proc_swaps(const char *fname) { + int i; ++ char *p = canonicalize_path(fname); + + for (i = 0; i < numSwaps; i++) +- if (swapFiles[i] && !strcmp(fname, swapFiles[i])) ++ if (swapFiles[i] && !strcmp(p, swapFiles[i])) { ++ free(p); + return 1; ++ } ++ free(p); + return 0; + } + diff --git a/util-linux.changes b/util-linux.changes index bf031ad..150828d 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Dec 14 16:11:34 UTC 2010 - puzel@novell.com + +- add util-linux-swapon-canonicalize-swap-device.patch + (bnc#641142) + ------------------------------------------------------------------- Thu Dec 2 17:09:08 CET 2010 - mszeredi@suse.cz diff --git a/util-linux.spec b/util-linux.spec index 1ec25de..cebcbfc 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -30,7 +30,7 @@ BuildRequires: pam-devel BuildRequires: pkg-config BuildRequires: readline-devel BuildRequires: zlib-devel -Url: http://userweb.kernel.org/~kzak/util-linux-ng/ +Url: http://kernel.org/~kzak/util-linux/ Supplements: filesystem(minix) Provides: fsck-with-dev-lock = %{version} # bnc#651598: @@ -85,6 +85,7 @@ Patch7: util-linux-swapon-btrfs-limitations Patch8: util-linux-agetty-s-option.patch Patch9: util-linux-fsck-l-option.patch Patch10: util-linux-2.18-no-canonicalize-fix.patch +Patch11: util-linux-swapon-canonicalize-swap-device.patch ## ## adjtimex ## @@ -194,6 +195,8 @@ Files to develop applications using the libmount library. %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 + # cd adjtimex-* # adjtimex patches belongs here