diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-08-30 16:56:41 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-08-30 16:56:41 +0900 |
commit | cb30d3ba665d9185d0691b265437e347d0d004fd (patch) | |
tree | e9cff3165b0404492430bbc0bf7c8995704dc7dc /src | |
parent | 40cdf0c962524afc7f85670e5bda8200ae6a9020 (diff) | |
download | systemd-cb30d3ba665d9185d0691b265437e347d0d004fd.tar.gz |
journal-remote: show error if SplitMode=host with 'active' source is specified
Diffstat (limited to 'src')
-rw-r--r-- | src/journal-remote/journal-remote.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 7201421d91..64b1105901 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -66,7 +66,7 @@ static int arg_seal = false; static int http_socket = -1, https_socket = -1; static char** arg_gnutls_log = NULL; -static JournalWriteSplitMode arg_split_mode = JOURNAL_WRITE_SPLIT_HOST; +static JournalWriteSplitMode arg_split_mode = _JOURNAL_WRITE_SPLIT_INVALID; static char* arg_output = NULL; static char *arg_key = NULL; @@ -1492,9 +1492,17 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; } + if (!IN_SET(arg_split_mode, JOURNAL_WRITE_SPLIT_NONE, _JOURNAL_WRITE_SPLIT_INVALID)) { + log_error("For active sources, only --split-mode=none is allowed."); + return -EINVAL; + } + arg_split_mode = JOURNAL_WRITE_SPLIT_NONE; } + if (arg_split_mode == _JOURNAL_WRITE_SPLIT_INVALID) + arg_split_mode = JOURNAL_WRITE_SPLIT_HOST; + if (arg_split_mode == JOURNAL_WRITE_SPLIT_NONE && arg_output) { if (is_dir(arg_output, true) > 0) { log_error("For SplitMode=none, output must be a file."); |