Blame SOURCES/1006-fix-file-permissions-secret-key-rh1709849.patch

7b922c
From a6562097a4d0f35c22c4f0f949012dee918bf510 Mon Sep 17 00:00:00 2001
7b922c
From: Thomas Haller <thaller@redhat.com>
7b922c
Date: Tue, 14 May 2019 13:55:41 +0200
7b922c
Subject: [PATCH 1/1] core: fix file permissions for
7b922c
 "/var/lib/NetworkManager/secret_key"
7b922c
7b922c
Ooherwise, the file has wrong permissions:
7b922c
7b922c
  # ls -la /var/lib/NetworkManager/secret_key
7b922c
  ----r-xr-x. 1 root root 50 May 14 13:52 /var/lib/NetworkManager/secret_key
7b922c
7b922c
Luckily, /var/lib/NetworkManager should be already
7b922c
7b922c
  # ls -lad /var/lib/NetworkManager
7b922c
  drwx------. 2 root root 8192 May 14 13:57 /var/lib/NetworkManager
7b922c
7b922c
which mitigates this a bit.
7b922c
7b922c
Fixes: dbcb1d6d97c6 ('core: let nm_utils_secret_key_read() handle failures internally')
7b922c
7b922c
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/175
7b922c
(cherry picked from commit dc3a2f9bc4c35030bcaf9e81953daf7894ab62b6)
7b922c
(cherry picked from commit 2d46247c6ac6f89a0b8bac86d684431c07dc6c8e)
7b922c
---
7b922c
 src/nm-core-utils.c | 2 +-
7b922c
 1 file changed, 1 insertion(+), 1 deletion(-)
7b922c
7b922c
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
7b922c
index b0cc914e7..fd1628027 100644
7b922c
--- a/src/nm-core-utils.c
7b922c
+++ b/src/nm-core-utils.c
7b922c
@@ -2697,7 +2697,7 @@ _host_id_read (guint8 **out_host_id,
7b922c
 		} else if (!nm_utils_file_set_contents (SECRET_KEY_FILE,
7b922c
 		                                        (const char *) new_content,
7b922c
 		                                        len,
7b922c
-		                                        0077,
7b922c
+		                                        0600,
7b922c
 		                                        &error)) {
7b922c
 			nm_log_warn (LOGD_CORE, "secret-key: failure to persist secret key in \"%s\" (%s) (use non-persistent key)",
7b922c
 			             SECRET_KEY_FILE, error->message);
7b922c
-- 
7b922c
2.21.0
7b922c