mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-06 21:49:55 +00:00
libselinux: Fix selabel_lookup() for the root dir.
9e4480b921
("Remove trailing slash on selabel_file lookups.") introduced
a bug which turns the root directory lookup "/" into an empty string.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
This commit is contained in:
parent
734e4beb55
commit
075f9cfe7a
@ -902,7 +902,7 @@ static const struct spec **lookup_all(struct selabel_handle *rec,
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (key[len - 1] == '/') {
|
||||
if (len > 1 && key[len - 1] == '/') {
|
||||
/* reuse clean_key from above if available */
|
||||
if (!clean_key) {
|
||||
clean_key = (char *) malloc(len);
|
||||
|
Loading…
Reference in New Issue
Block a user