All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libselinux:  label_file:  handle newlines in file names
@ 2015-02-24 15:43 Stephen Smalley
  2015-02-24 16:45 ` Steve Lawrence
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2015-02-24 15:43 UTC (permalink / raw)
  To: selinux; +Cc: Stephen Smalley

From: Nick Kralevich <nnk@google.com>

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>
---
 libselinux/src/label_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index 71b085a..9d116eb 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -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)
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-24 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 15:43 [PATCH] libselinux: label_file: handle newlines in file names Stephen Smalley
2015-02-24 16:45 ` Steve Lawrence
2015-02-24 16:54   ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.