Skip to content

Commit 22b4fe7

Browse files
committed
server session FEATURE handle expired accounts
Fixes #267
1 parent b4ff2fd commit 22b4fe7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/session_server_ssh.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@ auth_password_get_pwd_hash(const char *username)
700700
if (!spwd) {
701701
VRB("Failed to retrieve the shadow entry for \"%s\".", username);
702702
return NULL;
703+
} else if ((spwd->sp_expire > -1) && (spwd->sp_expire <= (time(NULL) / (60 * 60 * 24)))) {
704+
WRN("User \"%s\" account has expired.", username);
705+
return NULL;
703706
}
704707

705708
pass_hash = spwd->sp_pwdp;

0 commit comments

Comments
 (0)