1 |
commit: 7d6bc428460407eec6715b9aa2d303cc3a8f36a1 |
2 |
Author: Adam Duskett <Adamduskett <AT> outlook <DOT> com> |
3 |
AuthorDate: Tue Oct 10 22:00:30 2017 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 29 12:59:08 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=7d6bc428 |
7 |
|
8 |
fix regex escape sequence error. |
9 |
|
10 |
python3.6 will error out with the message "invalid escape sequence" |
11 |
in genhomedircon.py. This patch fixes these errors by turning the string |
12 |
in the into a raw string. |
13 |
|
14 |
support/genhomedircon.py | 16 ++++++++-------- |
15 |
1 file changed, 8 insertions(+), 8 deletions(-) |
16 |
|
17 |
diff --git a/support/genhomedircon.py b/support/genhomedircon.py |
18 |
index 036f5cc9..6662f412 100644 |
19 |
--- a/support/genhomedircon.py |
20 |
+++ b/support/genhomedircon.py |
21 |
@@ -189,13 +189,13 @@ def oldgenhomedircon(filecontextdir, filecontext): |
22 |
addme = 1 |
23 |
for regex in prefix_regex: |
24 |
#match a trailing (/*)? which is actually a bug in rpc_pipefs |
25 |
- regex = re.sub("\(/\*\)\?$", "", regex) |
26 |
+ regex = re.sub(r"\(/\*\)\?$", "", regex) |
27 |
#match a trailing .+ |
28 |
- regex = re.sub("\.+$", "", regex) |
29 |
+ regex = re.sub(r"\.+$", "", regex) |
30 |
#match a trailing .* |
31 |
- regex = re.sub("\.\*$", "", regex) |
32 |
+ regex = re.sub(r"\.\*$", "", regex) |
33 |
#strip a (/.*)? which matches anything trailing to a /*$ which matches trailing /'s |
34 |
- regex = re.sub("\(\/\.\*\)\?", "", regex) |
35 |
+ regex = re.sub(r"\(\/\.\*\)\?", "", regex) |
36 |
regex = regex + "/*$" |
37 |
if re.search(regex, potential, 0): |
38 |
addme = 0 |
39 |
@@ -391,13 +391,13 @@ class selinuxConfig: |
40 |
exists=1 |
41 |
for regex in prefix_regex: |
42 |
#match a trailing (/*)? which is actually a bug in rpc_pipefs |
43 |
- regex = re.sub("\(/\*\)\?$", "", regex) |
44 |
+ regex = re.sub(r"\(/\*\)\?$", "", regex) |
45 |
#match a trailing .+ |
46 |
- regex = re.sub("\.+$", "", regex) |
47 |
+ regex = re.sub(r"\.+$", "", regex) |
48 |
#match a trailing .* |
49 |
- regex = re.sub("\.\*$", "", regex) |
50 |
+ regex = re.sub(r"\.\*$", "", regex) |
51 |
#strip a (/.*)? which matches anything trailing to a /*$ which matches trailing /'s |
52 |
- regex = re.sub("\(\/\.\*\)\?", "", regex) |
53 |
+ regex = re.sub(r"\(\/\.\*\)\?", "", regex) |
54 |
regex = regex + "/*$" |
55 |
if re.search(regex, home, 0): |
56 |
exists = 0 |