X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Flog.c;h=078ccdc35bf709b842c32bb0075fb6dc65cf5dcd;hb=1f2b7175cf84bdbef6ee6917224658ba2adf43bf;hp=3941e3e1c202d0015b42e9ebff3a93174003efb0;hpb=f0ea29eaeb3449822bfbdfa839b00e323dfc523e;p=elogind.git diff --git a/src/shared/log.c b/src/shared/log.c index 3941e3e1c..078ccdc35 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -871,15 +871,17 @@ void log_parse_environment(void) { if (r < 0) log_warning("Failed to read /proc/cmdline. Ignoring: %s", strerror(-r)); else if (r > 0) { - char *w, *state; + const char *word, *state; size_t l; - FOREACH_WORD_QUOTED(w, l, line, state) { - if (l == 5 && startswith(w, "debug")) { + FOREACH_WORD_QUOTED(word, l, line, state) { + if (l == 5 && startswith(word, "debug")) { log_set_max_level(LOG_DEBUG); break; } } + if (!isempty(state)) + log_warning("Trailing garbage and the end of kernel commandline, ignoring."); } e = secure_getenv("SYSTEMD_LOG_TARGET");