From 0556b44eabdc9be59eb4fb4a72fc4e644b657ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Mon, 12 Nov 2018 12:51:55 +0100 Subject: [PATCH 04/15] compat: support with-smartcard-lock-on-removal (--smartcardaction=0) Resolves: https://github.com/pbrezina/authselect/issues/110 --- src/compat/authcompat.py.in.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compat/authcompat.py.in.in b/src/compat/authcompat.py.in.in index accb3385ade908c07451ee4824d6b62b012ea317..666dcd0df57962a789a8882c26535d95d3e75cf2 100755 --- a/src/compat/authcompat.py.in.in +++ b/src/compat/authcompat.py.in.in @@ -556,6 +556,13 @@ class AuthCompat: while feature in features: features.remove(feature) + # Add lock-on-smartcard-removal if requested + if self.options.isset("smartcardaction"): + if int(self.options.get("smartcardaction")) == 0: + features.append("with-smartcard-lock-on-removal") + else: + features.remove("with-smartcard-lock-on-removal") + # Remove duplicates. The order is not kept but that does not matter. features = list(set(features)) -- 2.17.2