Skip to content

Commit

Permalink
Handle the case where the session limit is already exceeded
Browse files Browse the repository at this point in the history
  • Loading branch information
vorlonofportland committed Apr 11, 2023
1 parent b286cd0 commit 22ed227
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pam_session_timelimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *handle,
return PAM_PERM_DENIED;
}

if (timeval <= used_time)
return PAM_PERM_DENIED;

timeval -= used_time;

runtime_max_sec = malloc(FORMAT_TIMESPAN_MAX);
Expand Down

0 comments on commit 22ed227

Please sign in to comment.