From bfcc92a92e95f6eb8100ee1b6ed260d6210a3337 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 28 Jul 2021 11:19:49 +0000 Subject: [PATCH] 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. --- stages/org.osbuild.nm.conn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stages/org.osbuild.nm.conn b/stages/org.osbuild.nm.conn index 5203055e..91899368 100755 --- a/stages/org.osbuild.nm.conn +++ b/stages/org.osbuild.nm.conn @@ -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