From: Mike Yuan Date: Sat, 3 Aug 2024 11:18:01 +0000 (+0200) Subject: core/dbus-execute: normalize "rename" arg properly X-Git-Tag: v257-rc1~740^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9db676d6bf05fe9d6019a769c87526d66e3b999a;p=thirdparty%2Fsystemd.git core/dbus-execute: normalize "rename" arg properly Follow-up for 40dd2a1c24b886d9e635fef8f7b5336700df03c3 Addresses https://github.com/systemd/systemd/pull/33916#discussion_r1702616229 --- diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c index c7c43ce7d38..264e2f0af64 100644 --- a/src/core/dbus-execute.c +++ b/src/core/dbus-execute.c @@ -2225,7 +2225,9 @@ int bus_exec_context_set_transient_property( if (!credential_glob_valid(glob)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Credential name or glob is invalid: %s", glob); - if (!isempty(rename) && !credential_name_valid(rename)) + rename = empty_to_null(rename); + + if (rename && !credential_name_valid(rename)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Credential name is invalid: %s", rename); empty = false;