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

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