]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Revert "logger: verify --size of large enough for message header"
authorKarel Zak <kzak@redhat.com>
Thu, 21 Oct 2021 16:44:32 +0000 (18:44 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Oct 2021 16:44:32 +0000 (18:44 +0200)
This reverts commit 2fdea5a26480d46ec9445b0ea17fc984f84eecc9.

misc-utils/logger.c

index 4511ab11418369b9513148bfc85eb7f9c0101809..25ff2b9308ee6567a3683b489265c0390f1a5d19 100644 (file)
@@ -548,11 +548,8 @@ static void syslog_rfc3164_header(struct logger_ctl *const ctl)
        } else
                hostname = xstrdup(NILVALUE);
 
-       if ((size_t) xasprintf(&ctl->hdr, "<%d>%.15s %s %.200s%s: ",
-                        ctl->pri, rfc3164_current_time(),
-                        hostname, ctl->tag, pid) > ctl->max_message_size)
-               errx(EXIT_FAILURE, _("maximal message size is smaller than message header"));
-
+       xasprintf(&ctl->hdr, "<%d>%.15s %s %.200s%s: ",
+                ctl->pri, rfc3164_current_time(), hostname, ctl->tag, pid);
 
        free(hostname);
 }
@@ -831,15 +828,14 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
        if (!structured)
                structured = xstrdup(NILVALUE);
 
-       if ((size_t) xasprintf(&ctl->hdr, "<%d>1 %s %s %s %s %s %s ",
-                       ctl->pri,
-                       time,
-                       hostname,
-                       app_name,
-                       procid,
-                       msgid,
-                       structured) > ctl->max_message_size)
-               errx(EXIT_FAILURE, _("maximal message size is smaller than message header"));
+       xasprintf(&ctl->hdr, "<%d>1 %s %s %s %s %s %s ",
+               ctl->pri,
+               time,
+               hostname,
+               app_name,
+               procid,
+               msgid,
+               structured);
 
        free(time);
        free(hostname);
@@ -889,9 +885,8 @@ static void syslog_local_header(struct logger_ctl *const ctl)
        else
                pid[0] = '\0';
 
-       if ((size_t) xasprintf(&ctl->hdr, "<%d>%s %s%s: ", ctl->pri, rfc3164_current_time(),
-                       ctl->tag, pid) > ctl->max_message_size)
-               errx(EXIT_FAILURE, _("maximal message size is smaller than message header"));
+       xasprintf(&ctl->hdr, "<%d>%s %s%s: ", ctl->pri, rfc3164_current_time(),
+               ctl->tag, pid);
 }
 
 static void generate_syslog_header(struct logger_ctl *const ctl)