forked from pool/util-linux
Accepting request 55969 from Base:System
Accepted submit request 55969 from user puzel OBS-URL: https://build.opensuse.org/request/show/55969 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=105
This commit is contained in:
parent
dbc9b8a0bd
commit
c3d67ddd14
41
util-linux-swapon-canonicalize-swap-device.patch
Normal file
41
util-linux-swapon-canonicalize-swap-device.patch
Normal file
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user