]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: add logs when credential value is duplicated 18289/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Jan 2021 16:32:49 +0000 (01:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Jan 2021 16:32:49 +0000 (01:32 +0900)
src/core/load-fragment.c

index dd31364a76f8e56a6f0a9e164fa63977a5717e1b..f3c2958b057c3f55abdf9d8a3d9a932bb06fb334 100644 (file)
@@ -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);
         }