]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hostnamed: make sure we can actually properly parse 'allowInteractiveAuthentication... 33503/head
authorLennart Poettering <lennart@poettering.net>
Thu, 27 Jun 2024 08:12:04 +0000 (10:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 27 Jun 2024 08:43:21 +0000 (10:43 +0200)
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)

src/hostname/hostnamed.c
src/shared/varlink-io.systemd.Hostname.c

index a8ebf97cd26d174e0e2f2a0f466554fefd4fb053..a0bf1bfdc89fcaabc8f6c672a6d5f0c8657513b2 100644 (file)
@@ -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)
index a6c6aec2a8c32f788b192e437cbb7664a5605f3c..247bca6da318e5c7f12964729429f6a7bab82672 100644 (file)
@@ -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),