]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: use FSS_HEADER_SIGNATURE at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Jun 2026 15:08:41 +0000 (00:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 27 Jun 2026 11:36:36 +0000 (20:36 +0900)
src/journal/journalctl-authenticate.c
src/libsystemd/sd-journal/journal-authenticate.c
src/libsystemd/sd-journal/journal-def.h

index b1ae033154d17a84f7bee5a6c083b891057c346e..721404a1f53f08715da3310b1fe1c3edaf0d8698 100644 (file)
@@ -139,7 +139,7 @@ int action_setup_keys(void) {
                                r, "Failed to set file attributes on a temporary file for '%s', ignoring: %m", path);
 
         struct FSSHeader h = {
-                .signature = { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' },
+                .signature = FSS_HEADER_SIGNATURE,
                 .machine_id = machine,
                 .boot_id = boot,
                 .header_size = htole64(sizeof(h)),
index 2d6522949506e531ce74d66bf2d7181e0bb6665f..db13dc1851e54a268d126d7eb131c853e68bcf4d 100644 (file)
@@ -392,7 +392,7 @@ int journal_file_fss_load(JournalFile *f) {
         if (header == MAP_FAILED)
                 return -errno;
 
-        if (memcmp(header->signature, FSS_HEADER_SIGNATURE, 8) != 0)
+        if (memcmp(header->signature, (const uint8_t[]) FSS_HEADER_SIGNATURE, 8) != 0)
                 return -EBADMSG;
 
         if (header->incompatible_flags != 0)
index 84849a1e9506d199e024c1f17d8a8fd22c91b46b..026aa4c941444c37e4ff11e2e14c443d8146051c 100644 (file)
@@ -261,7 +261,7 @@ assert_cc(sizeof(struct Header) == sizeof(struct Header__packed));
 assert_cc(sizeof(struct Header) == 272);
 
 #define FSS_HEADER_SIGNATURE                                            \
-        ((const char[]) { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' })
+        { 'K', 'S', 'H', 'H', 'R', 'H', 'L', 'P' }
 
 struct FSSHeader {
         uint8_t signature[8]; /* "KSHHRHLP" */