Commit Graph

11 Commits

Author SHA1 Message Date
Christian Göttsche
9e48ce1f2e genhomedircon: generate file contexts for %{USERNAME} and %{USERID}
Generate substituted file contexts for templated paths containing
%{USERNAME} or %{USERID}, like semodules' genhomedircon.

Example:
  /run/user/%{USERID}  -d  gen_context(system_u:object_r:user_runtime_t,s0)
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-01-31 21:53:33 +01:00
Christian Göttsche
cf8f7bbea7 genhomedircon: drop unused functions
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-01-31 21:50:21 +01:00
Christian Göttsche
806a0d12f8 genhomedircon: require match for home directory name
Use regular expression '/[^/]+' instead of '/[^/]*', like semodule's
genhomedircon.
Generates file contexts like '/home/[^/]+/dead\.letter'

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-01-31 21:50:18 +01:00
Christian Göttsche
577373f0db genhomedircon: drop backwards compatibility section
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2021-01-31 21:50:11 +01:00
Christian Göttsche
cdfd85c35b Correct some misspellings
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
2020-06-05 15:38:43 +02:00
Chris PeBenito
a229fb0e39 genhomedircon: Drop Python 2 compatibility code.
Python 2 is end-of-life.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-05-13 16:12:53 -04:00
Chris PeBenito
0bfd1387ac Remove incorrect usages of "is" operator from Python scripts.
Closes #128

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-11-23 10:12:53 -05:00
Chris PeBenito
0af99256c6 genhomedircon.py: Fix top-level exception handling.
Fixes errors like this:

Traceback (most recent call last):
  File "support/genhomedircon.py", line 490, in <module>
    errorExit("Options Error " + error)
TypeError: Can't convert 'GetoptError' object to str implicitly

Signed-off-by: Chris PeBenito <Christopher.PeBenito@microsoft.com>
2019-03-15 09:41:49 -04:00
Adam Duskett
6c9cc47e6c fix regex escape sequence error.
python3.6 will error out with the message "invalid escape sequence"
in genhomedircon.py.  This patch fixes these errors by turning the string
in the into a raw string.
2017-10-10 18:00:30 -04:00
cgzones
33fd9ae139 fix travis and genhomedircon 2017-03-18 18:38:20 +01:00
cgzones
82b0a6d4d5 convert build scripts to python3 2017-03-15 02:09:20 +01:00