From: Yu Watanabe Date: Sun, 17 Jan 2021 16:32:49 +0000 (+0900) Subject: core: add logs when credential value is duplicated X-Git-Tag: v248-rc1~311^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18289%2Fhead;p=thirdparty%2Fsystemd.git core: add logs when credential value is duplicated --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index dd31364a76f..f3c2958b057 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -4541,8 +4541,11 @@ int config_parse_set_credential( r = hashmap_ensure_put(&context->set_credentials, &exec_set_credential_hash_ops, sc->id, sc); if (r == -ENOMEM) return log_oom(); - if (r < 0) - return r; + if (r < 0) { + log_syntax(unit, LOG_WARNING, filename, line, l, + "Duplicated credential value '%s', ignoring assignment: %s", sc->id, rvalue); + return 0; + } TAKE_PTR(sc); }