Resolving linking errors
This commit is contained in:
@ -25,6 +25,18 @@ LICENSE : GNU-GPLv3
|
||||
#ifdef POWEROFF
|
||||
#ifdef CRYPTSETUP
|
||||
|
||||
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.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void argSplit(char **some_arg, char **some_temp, const char *arg){
|
||||
strncpy(*some_arg, arg, 128);
|
||||
*some_temp = strtok(*some_arg, "=");
|
||||
@ -56,13 +68,9 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, cons
|
||||
|
||||
|
||||
// Regex for checking arguments
|
||||
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\\}$";
|
||||
regex_t regex;
|
||||
|
||||
if(regcomp(®ex, pattern, 0)){
|
||||
pam_syslog(pamh, LOG_CRIT, "ERROR: Problem with regcomp.");
|
||||
if(makeRegex(pamh, ®ex))
|
||||
return (PAM_IGNORE);
|
||||
}
|
||||
|
||||
|
||||
// Argument handling
|
||||
|
Reference in New Issue
Block a user