mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-05 20:32:58 +00:00
Allow shell-style wildcard patterns in the X labeling backend.
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
This commit is contained in:
parent
f64fea9a0b
commit
66b2af371a
@ -11,6 +11,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <fnmatch.h>
|
||||
#include "callbacks.h"
|
||||
#include "label_internal.h"
|
||||
|
||||
@ -199,9 +200,7 @@ static struct selabel_lookup_rec *lookup(struct selabel_handle *rec,
|
||||
for (i = 0; i < data->nspec; i++) {
|
||||
if (spec_arr[i].type != type)
|
||||
continue;
|
||||
if (!strncmp(spec_arr[i].key, "*", 2))
|
||||
break;
|
||||
if (!strncmp(spec_arr[i].key, key, strlen(key) + 1))
|
||||
if (!fnmatch(spec_arr[i].key, key, 0))
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user