From da88c56b9f7c7ae54cfb1736ba64245d7179a894 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sat, 2 May 2020 23:54:04 +0200 Subject: [PATCH] warn if chrootless mode is run by the root user --- mmdebstrap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mmdebstrap b/mmdebstrap index 290aafb..6ace61a 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -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}"; }