From 51fc85bc845bf6c7de1962efe6458ec701051162 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Mon, 23 Feb 2015 21:46:52 -0800 Subject: 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 --- src/label_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/label_file.c b/src/label_file.c index b65e049..c860016 100644 --- a/src/label_file.c +++ b/src/label_file.c @@ -256,7 +256,7 @@ static int compile_regex(struct saved_data *data, spec_t *spec, const char **err *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) -- cgit v1.2.3