]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env 16792/head
authorLennart Poettering <lennart@poettering.net>
Wed, 19 Aug 2020 15:07:41 +0000 (17:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 19 Aug 2020 16:23:11 +0000 (18:23 +0200)
Fixes: #16758
src/core/machine-id-setup.c

index f76b82a8a45a18eb7a1981dcc50e1a1e232810db..90f03db6804c667845d4ec77026adb330a0c876e 100644 (file)
@@ -44,7 +44,7 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) {
                 fd = safe_close(fd);
         }
 
-        if (isempty(root)) {
+        if (isempty(root) && running_in_chroot() <= 0) {
                 /* If that didn't work, see if we are running in a container,
                  * and a machine ID was passed in via $container_uuid the way
                  * libvirt/LXC does it */