1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-18 21:57:48 +03:00

path-util: return error if fnmatch() fails

This commit is contained in:
Lennart Poettering 2022-08-29 11:07:11 +02:00
parent 8812f8fc65
commit 6eeadaa141

View File

@ -1336,8 +1336,11 @@ int path_glob_can_match(const char *pattern, const char *prefix, char **ret) {
if (!h)
return -ENOMEM;
if (fnmatch(g, h, 0) != 0)
r = fnmatch(g, h, 0);
if (r == FNM_NOMATCH)
break;
if (r != 0) /* Failure to process pattern? */
return -EINVAL;
}
/* The pattern does not match the prefix. */