add util-linux-swapon-canonicalize-swap-device.patch (bnc#641142)

OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=60
This commit is contained in:
Petr Uzel 2010-12-14 16:25:55 +00:00 committed by Git OBS Bridge
parent 4ebf1f5484
commit fda6a92214
4 changed files with 91 additions and 2 deletions

View File

@ -0,0 +1,24 @@
commit 1cf4c20b198c0c6566198fd00b983d9aaf8321bc
Author: Miklos Szeredi <miklos@szeredi.hu>
Date: Thu Oct 7 16:05:12 2010 +0200
mount: don't canonicalize "spec" with --no-canonicalize option
"Spec" was still canonicalized despite --no-canonicalize. This
resulted in a hang during login with pam_encfs (Debian Bug#593336).
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
diff --git a/mount/devname.c b/mount/devname.c
index 585d259..05da092 100644
--- a/mount/devname.c
+++ b/mount/devname.c
@@ -8,7 +8,7 @@ spec_to_devname(const char *spec)
{
if (!spec)
return NULL;
- if (is_pseudo_fs(spec))
+ if (nocanonicalize || is_pseudo_fs(spec))
return xstrdup(spec);
return fsprobe_get_devname_by_spec(spec);
}

View 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;
}

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
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
- mount: don't canonicalize "spec" with --no-canonicalize option
[bnc#651598]
-------------------------------------------------------------------
Thu Dec 2 15:23:36 CET 2010 - mszeredi@suse.cz
- add Provides: util-linux(fake+no-canonicalize) [bnc#651598]
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 30 12:19:53 UTC 2010 - puzel@novell.com Tue Nov 30 12:19:53 UTC 2010 - puzel@novell.com

View File

@ -30,15 +30,17 @@ BuildRequires: pam-devel
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
Url: http://userweb.kernel.org/~kzak/util-linux-ng/ Url: http://kernel.org/~kzak/util-linux/
Supplements: filesystem(minix) Supplements: filesystem(minix)
Provides: fsck-with-dev-lock = %{version} Provides: fsck-with-dev-lock = %{version}
# bnc#651598:
Provides: util-linux(fake+no-canonicalize)
PreReq: %install_info_prereq permissions PreReq: %install_info_prereq permissions
License: GPLv2+ License: GPLv2+
Group: System/Base Group: System/Base
AutoReqProv: on AutoReqProv: on
Version: 2.18 Version: 2.18
Release: 4 Release: 6
Recommends: %name-lang = %{version} Recommends: %name-lang = %{version}
Summary: A collection of basic system utilities Summary: A collection of basic system utilities
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v%{version}/%name-ng-%{version}.tar.bz2 Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v%{version}/%name-ng-%{version}.tar.bz2
@ -82,6 +84,8 @@ Patch4: util-linux-2.17.1-losetup-honor-documented-c-option
Patch7: util-linux-swapon-btrfs-limitations Patch7: util-linux-swapon-btrfs-limitations
Patch8: util-linux-agetty-s-option.patch Patch8: util-linux-agetty-s-option.patch
Patch9: util-linux-fsck-l-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 ## adjtimex
## ##
@ -190,6 +194,9 @@ Files to develop applications using the libmount library.
%patch7 -p1 %patch7 -p1
%patch8 -p1 %patch8 -p1
%patch9 -p1 %patch9 -p1
%patch10 -p1
%patch11 -p1
# #
cd adjtimex-* cd adjtimex-*
# adjtimex patches belongs here # adjtimex patches belongs here