putting pam_panic.c on gettext

This commit is contained in:
Bandie 2018-09-21 22:46:31 +02:00
parent 92968eb417
commit 9ee0585927
Signed by: Bandie
GPG Key ID: C1E133BC65A822DD
2 changed files with 14 additions and 4 deletions

View File

@ -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(&regex, 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

View File

@ -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"