core/dbus-execute: normalize "rename" arg properly

Follow-up for 40dd2a1c24

Addresses https://github.com/systemd/systemd/pull/33916#discussion_r1702616229
This commit is contained in:
Mike Yuan
2024-08-04 06:51:25 +02:00
parent f4911e6bda
commit 9db676d6bf
+3 -1
View File
@@ -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;