summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-14 13:55:41 +0200
committerThomas Haller <thaller@redhat.com>2019-05-14 13:59:08 +0200
commitdc3a2f9bc4c35030bcaf9e81953daf7894ab62b6 (patch)
tree4a4d471392fecc54c7903f4974b2ee95de5ae3eb
parenta7bda40129fd2fb6b3d8bbd125b242d3b6b6cec6 (diff)
downloadNetworkManager-dc3a2f9bc4c35030bcaf9e81953daf7894ab62b6.tar.gz
core: fix file permissions for "/var/lib/NetworkManager/secret_key"
Ooherwise, the file has wrong permissions: # ls -la /var/lib/NetworkManager/secret_key ----r-xr-x. 1 root root 50 May 14 13:52 /var/lib/NetworkManager/secret_key Luckily, /var/lib/NetworkManager should be already # ls -lad /var/lib/NetworkManager drwx------. 2 root root 8192 May 14 13:57 /var/lib/NetworkManager which mitigates this a bit. Fixes: dbcb1d6d97c6 ('core: let nm_utils_secret_key_read() handle failures internally') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/175
-rw-r--r--src/nm-core-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 02ce8c81c9..9330c9ed8f 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -2699,7 +2699,7 @@ _host_id_read (guint8 **out_host_id,
} else if (!nm_utils_file_set_contents (SECRET_KEY_FILE,
(const char *) new_content,
len,
- 0077,
+ 0600,
&error)) {
nm_log_warn (LOGD_CORE, "secret-key: failure to persist secret key in \"%s\" (%s) (use non-persistent key)",
SECRET_KEY_FILE, error->message);