setup-dchroot: fix root directory permissions
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 6 Apr 2017 07:17:29 +0000 (09:17 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Thu, 6 Apr 2017 07:17:29 +0000 (09:17 +0200)
When using stretch, the debootstrap process does not change the
permissions of the root directory of the chroot. As it is created
with mktemp, it ends up not being readable by a normal user like
"buildd". Change the permissions just before creating the tarball
to avoid that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
modules/schroot/files/setup-dchroot

index c1350cd..e63d723 100755 (executable)
@@ -392,6 +392,7 @@ tartmp=$(tempfile --directory "$basedir" --suffix=".tar.gz")
 cleanup+=("rm -f $tartmp")
 (
   cd "$rootdir"
+  chmod 0755 "$rootdir"
   tar caf "$tartmp" .
   if ! [ -z "$keep" ]; then
     savelog -l -c 4 "$target"