From e2b0cc3415980f7a145f8772f4ae0a4ad0fbe85a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 18 Oct 2017 08:57:54 +0900 Subject: [PATCH] core: fix invalid error message The error message corresponds to EILSEQ is "Invalid or incomplete multibyte or wide character", and is not suitable in this case. So, let's show a custom error message when the function dynamic_creds_realize() returns -EILSEQ. --- src/core/execute.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/execute.c b/src/core/execute.c index c4dfac9..36dbc28 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2798,6 +2798,10 @@ static int exec_child( r = dynamic_creds_realize(dcreds, suggested_paths, &uid, &gid); if (r < 0) { *exit_status = EXIT_USER; + if (r == -EILSEQ) { + log_unit_error(unit, "Failed to update dynamic user credentials: User or group with specified name already exists."); + return -EOPNOTSUPP; + } return log_unit_error_errno(unit, r, "Failed to update dynamic user credentials: %m"); } -- 2.7.4