machine-id-setup: don't use KVM or container manager supplied uuid if in chroot env

Fixes: #16758
This commit is contained in:
Lennart Poettering 2020-08-19 17:07:41 +02:00
parent caf6bd166f
commit 1f894e682c
1 changed files with 1 additions and 1 deletions

View 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 */