libselinux: Fix selabel_lookup() for the root dir.
PATCH v2 1/1 libselinux: Fix selabel_lookup() for the root dir.
9e4480b921bb ("Remove trailing slash on selabel_file lookups.") introduced a bug which turns the root directory lookup "/" into an empty string.
v2: Fix commit message
--- libselinux/src/label_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/src/label_file.c +1 -1
@@ -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);
Signature · 1 line
2.26.2
Quoted 3 lines · Chris PeBenito
9e4480b921bb("Remove trailing slash onselabel_filelookups.") introduced a bug which turns the root directory lookup "/" into an empty string.
Thanks.
Quoted 1 line
v2: Fix commit message
This should go after the --- so that it doesn't get included in the commit message since only the final version gets committed. But don't worry about re-posting just for that; I can just amend it before merging if I remember or if not no big deal.
Quoted 1 line
Signed-off-by Chris PeBenito <[email protected]>
Quoted 11 lines · Stephen Smalley
Quoted 3 lines · Chris PeBenito
9e4480b921bb("Remove trailing slash onselabel_filelookups.") introduced a bug which turns the root directory lookup "/" into an empty string.Thanks.
Quoted 1 line
v2: Fix commit message
Quoted 8 lines
This should go after the --- so that it doesn't get included in the commit message since only the final version gets committed. But don't worry about re-posting just for that; I can just amend it before merging if I remember or if not no big deal.
Quoted 1 line
Signed-off-by Chris PeBenito <[email protected]>Acked-by Stephen Smalley <[email protected]>
Applied.