From 7355ac9689e9213e0d4a1f1ed7f41e736842ec5c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 19 Aug 2020 17:07:41 +0200 Subject: machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env Fixes: #16758 (cherry picked from commit 1f894e682cb34d8d713378d01dc0565b7b5a245f) --- src/core/machine-id-setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c index f76b82a8a4..90f03db680 100644 --- a/src/core/machine-id-setup.c +++ b/src/core/machine-id-setup.c @@ -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 */ -- cgit v1.2.1