warn if chrootless mode is run by the root user

This commit is contained in:
Johannes 'josch' Schauer 2020-05-02 23:54:04 +02:00
parent 6af46f0b4a
commit da88c56b9f
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -3171,7 +3171,10 @@ sub main() {
exit 1;
}
} elsif ($options->{mode} eq 'chrootless') {
# nothing to do
if ($EFFECTIVE_USER_ID == 0) {
warning "running chrootless mode as root might damage the host "
. "system";
}
} else {
error "unknown mode: $options->{mode}";
}