Skip to content

Commit 0bcd9fd

Browse files
Dyrconachrissharp123
authored andcommitted
LP2120581: Report additional pcre2 error
Log the pcre2 error message if a barcode regex match fails for a reason other than a non-matching pattern. The previous code simply reported that an unknown error occurred. Signed-off-by: Jason Stephenson <[email protected]> Signed-off-by: Chris Sharp <[email protected]>
1 parent eb36c31 commit 0bcd9fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Open-ILS/src/c-apps/oils_auth.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,12 @@ static int oilsAuthIdentIsBarcode(const char* identifier, int org_id) {
397397

398398
if (match_ret >= 0) return 1; // regex matched
399399

400-
if (match_ret != PCRE2_ERROR_NOMATCH)
401-
osrfLogError(OSRF_LOG_MARK, "Unknown error processing barcode regex");
400+
if (match_ret != PCRE2_ERROR_NOMATCH) {
401+
PCRE2_UCHAR err_str[256];
402+
pcre2_get_error_message(match_ret, err_str, sizeof(err_str));
403+
osrfLogError(OSRF_LOG_MARK, "Error processing barcode regex: %s",
404+
(char *) err_str);
405+
}
402406

403407
return 0; // regex did not match
404408
}

0 commit comments

Comments
 (0)