Switch: Strict mode. Lock out if config is broken or not.

This commit is contained in:
2018-11-14 17:00:39 +01:00
parent 90714490d1
commit 01b4a1bbed
3 changed files with 20 additions and 7 deletions

View File

@ -62,7 +62,7 @@ int readPassword(pam_handle_t *pamh, char pw[2][99]){
}
int authPassword(pam_handle_t *pamh, char *serious_dev, int8_t bSerious, int8_t bReboot, int8_t bPoweroff){
int authPassword(pam_handle_t *pamh, char *serious_dev, int8_t bSerious, int8_t bReboot, int8_t bPoweroff, int8_t bStrict){
// gettext
setlocale (LC_ALL, "");
@ -84,7 +84,10 @@ int authPassword(pam_handle_t *pamh, char *serious_dev, int8_t bSerious, int8_t
// Read passwords from file
char pw[2][99];
if(readPassword(pamh, pw))
return(PAM_ABORT);
if(bStrict)
return(PAM_ABORT);
else
return(PAM_IGNORE);
for(int i=0; i<3; i++){