stages/nm.conn: set 0o600 permission for files

NetworkManager will refuse to load connection files that have the
to wide permsisions set. Restrict the files we create to 0o600.
This commit is contained in:
Christian Kellner 2021-07-28 11:19:49 +00:00 committed by Tom Gundersen
parent 6f7382b885
commit bfcc92a92e

View file

@ -188,6 +188,8 @@ def main(tree, options):
config.set(name, option, val)
with open(os.path.join(cfgdir, filename), "w") as f:
# need restrictive permissions
os.fchmod(f.fileno(), 0o600)
config.write(f, space_around_delimiters=False)
return 0