tag 383150 patch upstream fordwared 383150 [EMAIL PROTECTED] thanks The fix is attached.
-- ciao, Marco
diff -urp util-linux-2.12r/mount/Makefile util-linux-2.12r.canonicalize/mount/Makefile --- util-linux-2.12r/mount/Makefile 2004-12-22 10:32:08.000000000 +0100 +++ util-linux-2.12r.canonicalize/mount/Makefile 2006-08-20 11:10:06.000000000 +0200 @@ -58,7 +58,7 @@ umount: umount.o fstab.o sundries.o xmal $(LINK) $^ -o $@ $(BLKID_LIB) swapon: swapon.o version.o xmalloc.o \ - get_label_uuid.o mount_by_label.o mount_blkid.o + get_label_uuid.o mount_by_label.o mount_blkid.o realpath.o $(LINK) $^ -o $@ $(BLKID_LIB) main_losetup.o: lomount.c diff -urp util-linux-2.12r/mount/swapon.c util-linux-2.12r.canonicalize/mount/swapon.c --- util-linux-2.12r/mount/swapon.c 2004-12-22 10:50:19.000000000 +0100 +++ util-linux-2.12r.canonicalize/mount/swapon.c 2006-08-20 11:12:37.000000000 +0200 @@ -17,6 +17,12 @@ #include "nls.h" #include "mount_blkid.h" #include "mount_by_label.h" +#include "realpath.h" + +#include <limits.h> /* for PATH_MAX */ +#ifndef PATH_MAX +#define PATH_MAX 8192 +#endif #define streq(s, t) (strcmp ((s), (t)) == 0) @@ -137,9 +143,16 @@ read_proc_swaps(void) { static int is_in_proc_swaps(const char *fname) { int i; + char canonical[PATH_MAX + 2]; + + if (!myrealpath(fname, canonical, PATH_MAX + 1)) { + fprintf(stderr, _("%s: cannot canonicalize %s: %s\n"), + progname, fname, strerror(errno)); + strcpy(canonical, fname); + } for (i = 0; i < numSwaps; i++) - if (swapFiles[i] && !strcmp(fname, swapFiles[i])) + if (swapFiles[i] && !strcmp(canonical, swapFiles[i])) return 1; return 0; }
signature.asc
Description: Digital signature