summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2015-02-23 21:46:52 -0800
committerThe Android Automerger <android-build@google.com>2015-03-27 15:00:58 -0700
commit6608a1875b07370733d0f93f3a52febcef3442bf (patch)
treec9c60e41c0905e6bb864992cf56297a48a0969b1
parent678111299cd7e233a841b088292f63938912a37c (diff)
downloadlibselinux-6608a1875b07370733d0f93f3a52febcef3442bf.tar.gz
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
-rw-r--r--src/label_file.c2
1 files changed, 1 insertions, 1 deletions
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 @@ 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)