From: Lennart Poettering Date: Thu, 27 Jun 2024 08:12:04 +0000 (+0200) Subject: hostnamed: make sure we can actually properly parse 'allowInteractiveAuthentication... X-Git-Tag: v257-rc1~1036^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F33503%2Fhead;p=thirdparty%2Fsystemd.git hostnamed: make sure we can actually properly parse 'allowInteractiveAuthentication' varlink parameter If people want they should be able to turn on this flag, to allow interactive auth. Let's make sure this actually works. i.e. add it to the introspection data and don't refuse the parameter in Describe(). (note the varlink handling already does parameter validation through varlink_dispatch(), hence we can just drop any further validation) --- diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index a8ebf97cd26..a0bf1bfdc89 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -1636,9 +1636,6 @@ static int vl_method_describe(Varlink *link, sd_json_variant *parameters, Varlin * the product ID which we'll check explicitly. */ privileged = r > 0; - if (sd_json_variant_elements(parameters) > 0) - return varlink_error_invalid_parameter(link, parameters); - _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL; r = build_describe_response(c, privileged, &v); if (r < 0) diff --git a/src/shared/varlink-io.systemd.Hostname.c b/src/shared/varlink-io.systemd.Hostname.c index a6c6aec2a8c..247bca6da31 100644 --- a/src/shared/varlink-io.systemd.Hostname.c +++ b/src/shared/varlink-io.systemd.Hostname.c @@ -4,6 +4,7 @@ static VARLINK_DEFINE_METHOD( Describe, + VARLINK_DEFINE_INPUT(allowInteractiveAuthentication, VARLINK_BOOL, VARLINK_NULLABLE), VARLINK_DEFINE_OUTPUT(Hostname, VARLINK_STRING, 0), VARLINK_DEFINE_OUTPUT(StaticHostname, VARLINK_STRING, VARLINK_NULLABLE), VARLINK_DEFINE_OUTPUT(PrettyHostname, VARLINK_STRING, VARLINK_NULLABLE),