From 6da8791c118b132feff51503182b7e8ce5dda48d Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Mon, 1 Oct 2018 22:52:45 +0200 Subject: [PATCH] do not chmod bind mount targets as this would change permissions on the source of the mount --- mmdebstrap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmdebstrap b/mmdebstrap index 7448aed..d9bea18 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1059,6 +1059,7 @@ sub setup { die "type 1 not implemented"; } elsif ($type == 2) { # symlink symlink $linkname, "$options->{root}/$fname"; + chmod $mode, "$options->{root}/$fname"; } elsif ($type == 3 or $type == 4) { # character/block special if (!$options->{havemknod}) { open my $fh, '>', "$options->{root}/$fname" or die "cannot open $options->{root}/$fname: $!"; @@ -1068,12 +1069,12 @@ sub setup { } elsif ($type == 5) { # directory if (!$options->{havemknod}) { make_path "$options->{root}/$fname"; + chmod $mode, "$options->{root}/$fname"; } 0 == system('mount', '-o', 'bind', "/$fname", "$options->{root}/$fname") or die "mount failed: $?"; } else { die "unsupported type: $type"; } - chmod $mode, "$options->{root}/$fname"; } # We can only mount /proc and /sys after extracting the essential # set because if we mount it before, then base-files will not be able