[systemd-commits] 2 commits - src/journal src/shared

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Wed Feb 26 21:44:15 PST 2014


 src/journal/journalctl.c |    5 +++++
 src/shared/logs-show.c   |    5 +++++
 2 files changed, 10 insertions(+)

New commits:
commit 0b6b7c2004317da48e5bbd3078c5662d8f0061b6
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Wed Feb 26 23:01:43 2014 -0500

    journalctl: refuse extra arguments with --verify and similar
    
    Positional arguments only make sense with the default action.
    For other actions, complain instead of ignoring them silently.

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index a328ba1..0619b25 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -658,6 +658,11 @@ static int parse_argv(int argc, char *argv[]) {
                 return -EINVAL;
         }
 
+        if (arg_action != ACTION_SHOW && optind < argc) {
+                log_error("Extraneous arguments starting with '%s'", argv[optind]);
+                return -EINVAL;
+        }
+
         return 1;
 }
 

commit 47d80904a1f72d559962cc5ad32fffd46672a34a
Author: Uoti Urpala <uoti.urpala at pp1.inet.fi>
Date:   Thu Feb 20 03:00:09 2014 +0200

    logs-show: fix corrupt output with empty messages
    
    If a message had zero length, journalctl would print no newline, and
    two output lines would be concatenated. Fix. The problem was
    introduced in commit 31f7bf199452 ("logs-show: print multiline
    messages"). Affected short and verbose output modes.
    
    Before fix:
    
    Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit
    
    after:
    
    Feb 09 21:16:17 glyph dhclient[1323]:
    Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit

diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 61c3652..12d4a1c 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -124,6 +124,11 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output
                 }
         }
 
+        /* A special case: make sure that we print a newline when
+           the message is empty. */
+        if (message_len == 0)
+                fputs("\n", f);
+
         for (pos = message;
              pos < message + message_len;
              pos = end + 1, line++) {



More information about the systemd-commits mailing list