From fcc40dc12249ca9ee8f8a223537f573796f79898 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 21 Sep 2018 18:57:57 +0200 Subject: [PATCH] chmod 0755 root directory so that other users (like _apt) can access it --- mmdebstrap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index d6803fc..986e7ed 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1151,6 +1151,12 @@ sub main() { # since the output is a tarball, we create the rootfs in a temporary # directory $options->{root} = tempdir(); + # in unshare and root mode, other users than the current user need to + # access the rootfs, most prominently, the _apt user. Thus, make the + # temporary directory world readable. + if (grep { $_ eq $options->{mode} } ('unshare', 'root')) { + chmod 0755, $options->{root} or die "cannot chmod root: $!"; + } } else { # user does not seem to have specified a tarball as output, thus work # directly in the supplied directory