mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-13 00:40:52 +00:00
libselinux: label_file: handle newlines in file names
restorecon on file names with newlines are not handled properly. Use PCRE_DOTALL so that dots in regular expressions match all characters, and don't exclude the newline character. See https://www.mail-archive.com/seandroid-list@tycho.nsa.gov/msg02001.html for background. Change-Id: I0dde8f2567305f746d19ebd75a9e2add7406eb9a Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
parent
b2beb5304d
commit
716e3820c5
@ -129,7 +129,7 @@ static int compile_regex(struct saved_data *data, struct spec *spec, const char
|
||||
*cp = '\0';
|
||||
|
||||
/* Compile the regular expression. */
|
||||
spec->regex = pcre_compile(anchored_regex, 0, &tmperrbuf, &erroff, NULL);
|
||||
spec->regex = pcre_compile(anchored_regex, PCRE_DOTALL, &tmperrbuf, &erroff, NULL);
|
||||
free(anchored_regex);
|
||||
if (!spec->regex) {
|
||||
if (errbuf)
|
||||
|
Loading…
Reference in New Issue
Block a user