From 489e51a2ebc2785d4828deb5030b71214d09fbad Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Wed, 16 Feb 2022 10:52:58 +0100 Subject: [PATCH] Run File::Find::find with no_chdir=>1 Without no_chdir=>1 the unshared child process in unshare mode needs read permissions for the directory from which mmdebstrap is executed. With this change, the current working directory does not need to be world-readable anymore. Closes: #1005857 Reported-by: Trent W. Buck --- mmdebstrap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mmdebstrap b/mmdebstrap index d8ee1ec..8f72a04 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -4094,7 +4094,10 @@ sub approx_disk_usage { $installed_size += 1; } }; - find($scan_installed_size, $directory); + # We use no_chdir because otherwise the unshared user has to have read + # permissions for the current working directory when producing an ext2 + # image. See https://bugs.debian.org/1005857 + find({ wanted => $scan_installed_size, no_chdir => 1 }, $directory); # because the above is only a heuristic we add 10% extra for good measure return int($installed_size * 1.1);