diff options
author | Nick Kralevich <nnk@google.com> | 2015-02-23 21:46:52 -0800 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-03-27 15:00:58 -0700 |
commit | 6608a1875b07370733d0f93f3a52febcef3442bf (patch) | |
tree | c9c60e41c0905e6bb864992cf56297a48a0969b1 | |
parent | 678111299cd7e233a841b088292f63938912a37c (diff) | |
download | libselinux-6608a1875b07370733d0f93f3a52febcef3442bf.tar.gz |
DO NOT MERGE: handle newlines in file namesandroid-cts-5.1_r9android-cts-5.1_r8android-cts-5.1_r7android-cts-5.1_r6android-cts-5.1_r5android-cts-5.1_r4android-cts-5.1_r3android-cts-5.1_r28android-cts-5.1_r27android-cts-5.1_r26android-cts-5.1_r25android-cts-5.1_r24android-cts-5.1_r23android-cts-5.1_r22android-cts-5.1_r21android-cts-5.1_r20android-cts-5.1_r2android-cts-5.1_r19android-cts-5.1_r18android-cts-5.1_r17android-cts-5.1_r16android-cts-5.1_r15android-cts-5.1_r14android-cts-5.1_r13android-cts-5.1_r10android-cts-5.1_r1android-5.1.1_r9android-5.1.1_r8android-5.1.1_r6android-5.1.1_r4android-5.1.1_r38android-5.1.1_r37android-5.1.1_r36android-5.1.1_r35android-5.1.1_r34android-5.1.1_r33android-5.1.1_r30android-5.1.1_r3android-5.1.1_r29android-5.1.1_r26android-5.1.1_r25android-5.1.1_r24android-5.1.1_r23android-5.1.1_r20android-5.1.1_r2android-5.1.1_r19android-5.1.1_r18android-5.1.1_r16android-5.1.1_r15android-5.1.1_r14android-5.1.1_r13android-5.1.1_r10android-5.1.1_r1lollipop-mr1-releaselollipop-mr1-fi-releaselollipop-mr1-cts-release
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.c | 2 |
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) |