From 90b2f184225822531be720ec347a96f920059ad1c9c9ad0c1c21986995e88f3a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 17 Nov 2018 19:38:26 +0000 Subject: [PATCH] Accepting request 649899 from home:buschmann23:branches:Linux-PAM - Add pam_mount-2.16-fix-luks2-mount.patch: fix mounting of LUKS2 volumes OBS-URL: https://build.opensuse.org/request/show/649899 OBS-URL: https://build.opensuse.org/package/show/Linux-PAM/pam_mount?expand=0&rev=58 --- pam_mount-2.16-fix-luks2-mount.patch | 45 ++++++++++++++++++++++++++++ pam_mount.changes | 6 ++++ pam_mount.spec | 9 +++--- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 pam_mount-2.16-fix-luks2-mount.patch diff --git a/pam_mount-2.16-fix-luks2-mount.patch b/pam_mount-2.16-fix-luks2-mount.patch new file mode 100644 index 0000000..8bebaeb --- /dev/null +++ b/pam_mount-2.16-fix-luks2-mount.patch @@ -0,0 +1,45 @@ +From: Matthias Fehring +Date: 2018-11-17 09:20:00 +0100 +Subject: fix mounting of LUKS2 volumes +Upstream: submitted (https://sourceforge.net/p/pam-mount/pam-mount/merge-requests/2/) + +Cryptsetup version 2.0 added support for LUKS2. +This patch adds support for mounting LUKS2 volumes with pam_mount. + +--- + crypto-dmc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/src/crypto-dmc.c 2016-09-23 09:52:47.000000000 +0200 ++++ b/src/crypto-dmc.c 2018-11-17 09:17:11.357766056 +0100 +@@ -21,6 +21,12 @@ + #include "libcryptmount.h" + #include "pam_mount.h" + ++#ifndef CRYPT_LUKS ++#define CRYPT_LUKS NULL /* Passing NULL to crypt_load will ++ default to LUKS(1) on older ++ libcryptsetup versions. */ ++#endif ++ + /** + * dmc_is_luks - check if @path points to a LUKS volume (cf. normal dm-crypt) + * @path: path to the crypto container +@@ -48,7 +54,7 @@ + + ret = crypt_init(&cd, device); + if (ret == 0) { +- ret = crypt_load(cd, CRYPT_LUKS1, NULL); ++ ret = crypt_load(cd, CRYPT_LUKS, NULL); + if (ret == -EINVAL) + ret = false; + else if (ret == 0) +@@ -106,7 +112,7 @@ + #endif + } + +- ret = crypt_load(cd, CRYPT_LUKS1, NULL); ++ ret = crypt_load(cd, CRYPT_LUKS, NULL); + if (ret == 0) { + ret = crypt_activate_by_passphrase(cd, mt->crypto_name, + CRYPT_ANY_SLOT, req->key_data, req->key_size, flags); diff --git a/pam_mount.changes b/pam_mount.changes index d916320..5b09c88 100644 --- a/pam_mount.changes +++ b/pam_mount.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Nov 17 09:18:54 UTC 2018 - Matthias Fehring + +- Add pam_mount-2.16-fix-luks2-mount.patch: + fix mounting of LUKS2 volumes + ------------------------------------------------------------------- Fri Sep 30 08:13:57 UTC 2016 - jengelh@inai.de diff --git a/pam_mount.spec b/pam_mount.spec index 05428e5..85ff9bd 100644 --- a/pam_mount.spec +++ b/pam_mount.spec @@ -1,7 +1,7 @@ # # spec file for package pam_mount # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,14 +12,14 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: pam_mount %define lname libcryptmount0 Summary: A PAM Module that can Mount Volumes for a User Session -License: LGPL-2.1+ and GPL-2.0+ +License: LGPL-2.1-or-later AND GPL-2.0-or-later Group: System/Libraries Version: 2.16 Release: 0 @@ -33,7 +33,7 @@ Source3: mount.crypt Source5: baselibs.conf Source6: %{name}.keyring Patch1: pam_mount-0.47-enable-logout-kill.dif - +Patch2: pam_mount-2.16-fix-luks2-mount.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: fdupes BuildRequires: libtool @@ -100,6 +100,7 @@ and transparent use of the OS's crypto layer. %prep %setup -q %patch -P 1 -p1 +%patch -P 2 -p1 %build %configure --disable-static --with-slibdir="/%_lib" \