commit:     ff997817fbbfcd7ff8277022791be60208eab6f0
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  4 15:38:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 23 23:46:35 2025 +0000
URL:        https://gitweb.gentoo.org/proj/pambase.git/commit/?id=ff997817

Make pam_shells optional

Bug: https://bugs.gentoo.org/939892
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 pambase.py                          | 1 +
 templates/system-login.tpl          | 2 ++
 tests/rendered/default/system-login | 1 -
 tests/rendered/minimal/system-login | 1 -
 tox.ini                             | 2 +-
 5 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pambase.py b/pambase.py
index ceec8cb..b54f270 100755
--- a/pambase.py
+++ b/pambase.py
@@ -19,6 +19,7 @@ def main():
     parser.add_argument('--mktemp', action="store_true", help='enable 
pam_mktemp.so module')
     parser.add_argument('--pam-ssh', action="store_true", help='enable 
pam_ssh.so module')
     parser.add_argument('--securetty', action="store_true", help='enable 
pam_securetty.so module')
+    parser.add_argument('--shells', action="store_true", help='enable 
pam_shells.so module')
     parser.add_argument('--sssd', action="store_true", help='enable sssd.so 
module')
     parser.add_argument('--yescrypt', action="store_true", help='enable 
yescrypt option for pam_unix.so module')
     parser.add_argument('--sha512', action="store_true", help='enable sha512 
option for pam_unix.so module')

diff --git a/templates/system-login.tpl b/templates/system-login.tpl
index 0269296..e2bc1a7 100644
--- a/templates/system-login.tpl
+++ b/templates/system-login.tpl
@@ -1,4 +1,6 @@
+{% if shells %}
 auth           required        pam_shells.so {{ debug|default('', true) }}
+{% endif %}
 auth           required        pam_nologin.so
 auth           include         system-auth
 

diff --git a/tests/rendered/default/system-login 
b/tests/rendered/default/system-login
index ae763fc..56cf515 100644
--- a/tests/rendered/default/system-login
+++ b/tests/rendered/default/system-login
@@ -1,4 +1,3 @@
-auth           required        pam_shells.so
 auth           required        pam_nologin.so
 auth           include         system-auth
 account                required        pam_access.so

diff --git a/tests/rendered/minimal/system-login 
b/tests/rendered/minimal/system-login
index cb63f65..9dcef7f 100644
--- a/tests/rendered/minimal/system-login
+++ b/tests/rendered/minimal/system-login
@@ -1,4 +1,3 @@
-auth           required        pam_shells.so
 auth           required        pam_nologin.so
 auth           include         system-auth
 account                required        pam_access.so

diff --git a/tox.ini b/tox.ini
index 818a012..91bf0e7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,5 +14,5 @@ commands =
     default: diff -Nru tests/rendered/default stack
     minimal: python pambase.py --minimal
     minimal: diff -Nru tests/rendered/minimal stack
-    custom: python pambase.py --elogind --nullok --passwdqc --sha512
+    custom: python pambase.py --elogind --nullok --passwdqc --sha512 --shells
     custom: diff -Nru tests/rendered/custom stack

Reply via email to