summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2024-12-16 03:50:53 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-12-16 22:36:07 +0100
commita4d18914751e687c9e44f22fe4e5f95b843a45c8 (patch)
tree637fbd73f34dcde8cd0a08dccca72405f0d0939f /tools
parentnetworkd: show wireguard private key read error number (diff)
downloadsystemd-a4d18914751e687c9e44f22fe4e5f95b843a45c8.tar.xz
systemd-a4d18914751e687c9e44f22fe4e5f95b843a45c8.zip
meson: allow to customize the access mode for tty/pts devices
Then, switch the default value to "0600", due to general security concerns about terminals being written to by other users. Closing #35599.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/meson-render-jinja2.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/meson-render-jinja2.py b/tools/meson-render-jinja2.py
index 977de79378..1f893ed9a4 100755
--- a/tools/meson-render-jinja2.py
+++ b/tools/meson-render-jinja2.py
@@ -17,7 +17,9 @@ def parse_config_h(filename):
if not m:
continue
a, b = m.groups()
- if b and b[0] in '0123456789"':
+ # The function ast.literal_eval() cannot evaluate octal integers, e.g. 0600.
+ # So, it is intentional that the string below does not contain '0'.
+ if b and (b[0] in '123456789"' or b == '0'):
b = ast.literal_eval(b)
ans[a] = b
return ans