putting pam_panic.c on gettext
This commit is contained in:
		| @@ -16,12 +16,18 @@ LICENSE :      GNU-GPLv3 | ||||
| #include <security/pam_modules.h> | ||||
| #include <security/pam_ext.h> | ||||
| #include <syslog.h> | ||||
| #include "config.h" | ||||
|  | ||||
| #include "pam_panic_reject.h" | ||||
| #include "../../lib/gettext.h" | ||||
|  | ||||
| #define _(String) gettext(String) | ||||
|  | ||||
| #include "pam_panic_authdevice.h" | ||||
| #include "pam_panic_password.h" | ||||
|  | ||||
|  | ||||
| #ifdef PACKAGE | ||||
| #ifdef LOCALEDIR | ||||
| #ifdef REBOOT | ||||
| #ifdef POWEROFF | ||||
| #ifdef CRYPTSETUP | ||||
| @@ -30,7 +36,7 @@ int makeRegex(pam_handle_t *pamh, regex_t *regex){ | ||||
|   char *pattern = "^[A-Fa-f0-9]\\{8\\}\\-[A-Fa-f0-9]\\{4\\}\\-[A-Fa-f0-9]\\{4\\}\\-[A-Fa-f0-9]\\{4\\}\\-[A-Fa-f0-9]\\{12\\}$"; | ||||
|  | ||||
|   if(regcomp(regex, pattern, 0)){ | ||||
|     pam_syslog(pamh, LOG_CRIT, "ERROR: Problem with regcomp."); | ||||
|     pam_syslog(pamh, LOG_CRIT, _("CRITICAL: Problem with regcomp.")); | ||||
|     return 1; | ||||
|   } | ||||
|    | ||||
| @@ -107,7 +113,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,	int argc, cons | ||||
|       || (rejected_temp != NULL && regexec(®ex, rejected_temp, 0, NULL, 0) == REG_NOMATCH) | ||||
|       || (bSerious && serious_temp == NULL) | ||||
|     ) { | ||||
|     pam_syslog(pamh, LOG_ERR, "Arguments invalid. Note that allow and reject must have a valid GPT UUID."); | ||||
|     pam_syslog(pamh, LOG_ERR, _("ERROR: Arguments invalid. Note that \"allow\" and \"reject\" must have a valid GPT UUID.")); | ||||
|     return (PAM_ABORT); | ||||
|   }  | ||||
|  | ||||
| @@ -143,7 +149,7 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags,	int argc, cons | ||||
|  | ||||
|   // Check if panic key exist | ||||
|   if(bSerious && access(serious_dev, F_OK) == -1){ | ||||
|     pam_syslog(pamh, LOG_ALERT, "ALERT for argument \"serious\": Device doesn't exist."); | ||||
|     pam_syslog(pamh, LOG_ALERT, _("ALERT for argument \"serious\": Device doesn't exist.")); | ||||
|     return (PAM_ABORT); | ||||
|   } | ||||
|  | ||||
| @@ -201,3 +207,5 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const c | ||||
| #endif | ||||
| #endif | ||||
| #endif | ||||
| #endif | ||||
| #endif | ||||
|   | ||||
| @@ -17,6 +17,8 @@ LICENSE :      GNU-GPLv3 | ||||
| #include <security/pam_modules.h> | ||||
| #include <security/pam_ext.h> | ||||
| #include <syslog.h> | ||||
| #include "../../lib/gettext.h" | ||||
|  | ||||
| #include "pam_panic_reject.h" | ||||
| #include "pam_panic_authdevice.h" | ||||
| #include "pam_panic_password.h" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user