DO NOT MERGE: 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.
(cherry picked from commit 51fc85bc845bf6c7de1962efe6458ec701051162)
Change-Id: I413ff130e4328b8325be78d9fab119a466df84f3
diff --git a/src/label_file.c b/src/label_file.c
index 1952cd0..a9d2c56 100644
--- a/src/label_file.c
+++ b/src/label_file.c
@@ -256,7 +256,7 @@
*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)