diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-04-28 14:32:49 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-04-29 16:39:09 +0200 |
commit | 66ee229879f998d6d1d02a1db23b906237d5258e (patch) | |
tree | e2fa7ae4a1351c0e76e641fa37b9e8dbf4e8e36e /src/hostname | |
parent | b4be4ff8ae0c7ab54a60f77b95f967131e1fcc6b (diff) | |
download | systemd-66ee229879f998d6d1d02a1db23b906237d5258e.tar.gz |
hostnamed: retrieve product UUID after authentication, not before
Diffstat (limited to 'src/hostname')
-rw-r--r-- | src/hostname/hostnamed.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 92af4d1913..27d9fecbc1 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -938,18 +938,6 @@ static int method_get_product_uuid(sd_bus_message *m, void *userdata, sd_bus_err assert(m); assert(c); - r = id128_get_product(&uuid); - if (r < 0) { - if (r == -EADDRNOTAVAIL) - log_debug_errno(r, "DMI product UUID is all 0x00 or all 0xFF, ignoring."); - else - log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r, - "Failed to read product UUID, ignoring: %m"); - - return sd_bus_error_set(error, BUS_ERROR_NO_PRODUCT_UUID, - "Failed to read product UUID from firmware."); - } - r = sd_bus_message_read(m, "b", &interactive); if (r < 0) return r; @@ -968,6 +956,18 @@ static int method_get_product_uuid(sd_bus_message *m, void *userdata, sd_bus_err if (r == 0) return 1; /* No authorization for now, but the async polkit stuff will call us again when it has it */ + r = id128_get_product(&uuid); + if (r < 0) { + if (r == -EADDRNOTAVAIL) + log_debug_errno(r, "DMI product UUID is all 0x00 or all 0xFF, ignoring."); + else + log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r, + "Failed to read product UUID, ignoring: %m"); + + return sd_bus_error_set(error, BUS_ERROR_NO_PRODUCT_UUID, + "Failed to read product UUID from firmware."); + } + r = sd_bus_message_new_method_return(m, &reply); if (r < 0) return r; |