summaryrefslogtreecommitdiff
path: root/modules/pam_unix/support.h
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2019-10-31 12:26:31 +0100
committerTomáš Mráz <t8m@users.noreply.github.com>2020-02-18 11:14:27 +0100
commitf5adefa106e28c92dd73dbabac12bad667ef7b8f (patch)
tree3193ef03dfdb94021de12695b5a6d7be1a69c6f7 /modules/pam_unix/support.h
parentf07a873240de53e07897d4ef9d1d3fd0c28fe7bb (diff)
pam_unix: add nullresetok option to allow reset blank passwords
Adding nullresetok to auth phase of pam_unix module will allow users with blank password to authenticate in order to immediatelly change their password even if nullok is not set. This allows to have blank password authentication disabled but still allows administrator to create new user accounts with expired blank password that must be change on the first login.
Diffstat (limited to 'modules/pam_unix/support.h')
-rw-r--r--modules/pam_unix/support.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/pam_unix/support.h b/modules/pam_unix/support.h
index e02c05e0..19754dc1 100644
--- a/modules/pam_unix/support.h
+++ b/modules/pam_unix/support.h
@@ -100,8 +100,9 @@ typedef struct {
#define UNIX_DES 30 /* DES, default */
#define UNIX_GOST_YESCRYPT_PASS 31 /* new password hashes will use gost-yescrypt */
#define UNIX_YESCRYPT_PASS 32 /* new password hashes will use yescrypt */
+#define UNIX_NULLRESETOK 33 /* allow empty password if password reset is enforced */
/* -------------- */
-#define UNIX_CTRLS_ 33 /* number of ctrl arguments defined */
+#define UNIX_CTRLS_ 34 /* number of ctrl arguments defined */
#define UNIX_DES_CRYPT(ctrl) (off(UNIX_MD5_PASS,ctrl)&&off(UNIX_BIGCRYPT,ctrl)&&off(UNIX_SHA256_PASS,ctrl)&&off(UNIX_SHA512_PASS,ctrl)&&off(UNIX_BLOWFISH_PASS,ctrl)&&off(UNIX_GOST_YESCRYPT_PASS,ctrl)&&off(UNIX_YESCRYPT_PASS,ctrl))
@@ -143,6 +144,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
/* UNIX_DES */ {"des", _ALL_ON_^(015660420000ULL), 0, 1},
/* UNIX_GOST_YESCRYPT_PASS */ {"gost_yescrypt", _ALL_ON_^(015660420000ULL), 04000000000, 1},
/* UNIX_YESCRYPT_PASS */ {"yescrypt", _ALL_ON_^(015660420000ULL), 010000000000, 1},
+/* UNIX_NULLRESETOK */ {"nullresetok", _ALL_ON_, 020000000000, 0},
};
#define UNIX_DEFAULTS (unix_args[UNIX__NONULL].flag)
@@ -171,6 +173,9 @@ extern int _unix_blankpasswd(pam_handle_t *pamh, unsigned long long ctrl,
extern int _unix_verify_password(pam_handle_t * pamh, const char *name,
const char *p, unsigned long long ctrl);
+extern int _unix_verify_user(pam_handle_t *pamh, unsigned long long ctrl,
+ const char *name, int *daysleft);
+
extern int _unix_run_verify_binary(pam_handle_t *pamh,
unsigned long long ctrl,
const char *user, int *daysleft);