]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: do not print special glyphs to the log 36745/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 9 Mar 2025 09:50:04 +0000 (10:50 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 15 Mar 2025 13:40:52 +0000 (14:40 +0100)
The log line looked like this:
  bootctl[1457]: ! Mount point '/efi' which backs the random seed file is world accessible, which is a security hole! !
which doesn't look nice.

Also upgrade the message to error. This is something to fix.

src/bootctl/bootctl-random-seed.c

index 0c6f2e725790e1960ff6aca10cb04b91782fe8a2..2c81ee32b7a0043689cf8232964d31f9074a7c1a 100644 (file)
@@ -40,13 +40,15 @@ static int random_seed_verify_permissions(int fd, mode_t expected_type) {
                 return 0;
 
         if (S_ISREG(expected_type))
-                log_warning("%s Random seed file '%s' is world accessible, which is a security hole! %s",
-                            glyph(GLYPH_WARNING_SIGN), full_path, glyph(GLYPH_WARNING_SIGN));
-        else {
-                assert(S_ISDIR(expected_type));
-                log_warning("%s Mount point '%s' which backs the random seed file is world accessible, which is a security hole! %s",
-                            glyph(GLYPH_WARNING_SIGN), full_path, glyph(GLYPH_WARNING_SIGN));
-        }
+                log_error("%s%sRandom seed file '%s' is world accessible, which is a security hole!%s%s",
+                          optional_glyph(GLYPH_WARNING_SIGN), optional_glyph(GLYPH_SPACE),
+                          full_path,
+                          optional_glyph(GLYPH_SPACE), optional_glyph(GLYPH_WARNING_SIGN));
+        else
+                log_error("%s%s Mount point '%s' which backs the random seed file is world accessible, which is a security hole! %s%s",
+                          optional_glyph(GLYPH_WARNING_SIGN), optional_glyph(GLYPH_SPACE),
+                          full_path,
+                          optional_glyph(GLYPH_SPACE), optional_glyph(GLYPH_WARNING_SIGN));
 
         return 1;
 }