pam-mount: add LUKS2 patch

closes #6837
This commit is contained in:
Nathan Owens 2019-01-08 22:55:34 -06:00 committed by maxice8
parent 998d6ddf48
commit 93347be9a6
No known key found for this signature in database
GPG Key ID: 543B9D4F4299F06B
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From: https://sourceforge.net/p/pam-mount/pam-mount/ci/d4434c05e7c0cf05d87089404cfa2deedc60811a/tree/src/crypto-dmc.c?diff=e47b8ee42f14926b013a78cc487b794059edccff
--- src/crypto-dmc.c
+++ src/crypto-dmc.c
@@ -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);

View File

@ -1,7 +1,7 @@
# Template file for 'pam-mount' # Template file for 'pam-mount'
pkgname=pam-mount pkgname=pam-mount
version=2.16 version=2.16
revision=3 revision=4
wrksrc="pam_mount-${version}" wrksrc="pam_mount-${version}"
build_style=gnu-configure build_style=gnu-configure
configure_args="--with-ssbindir=/usr/bin --with-slibdir=/usr/lib" configure_args="--with-ssbindir=/usr/bin --with-slibdir=/usr/lib"