Hi,

Quoting Trent W. Buck (2022-02-16 06:19:46)
> mmdebstrap's approx_disk_usage calls File::Find find(), which
> for some reason cares about the permissions of $PWD.
> This is the case even when writing the .ext2 somewhere else.
> 
>     bash5$ mkdir /tmp/a
>     bash5$ cd /tmp/a
>     bash5$ mmdebstrap sid /tmp/b.ext2 --quiet
>     copying from tar archive -
>     copying from tar archive -
>     bash5$ ls -lh /tmp/b.ext2
>     -rw-r--r-- 1 twb twb 306M 2022-02-16 16:11 /tmp/b.ext2
> 
>     bash5$ chmod 0700 .
>     bash5$ pwd
>     /tmp/a
>     bash5$ mmdebstrap sid /tmp/b.ext2 --quiet
>     copying from tar archive -
>     Can't cd to /tmp/a: Permission denied
>     Use of uninitialized value $numblocks in chomp at /usr/bin/mmdebstrap 
> line 5607.
>     Use of uninitialized value $numblocks in numeric le (<=) at 
> /usr/bin/mmdebstrap line 5636.
>     Use of uninitialized value $numblocks in concatenation (.) or string at 
> /usr/bin/mmdebstrap line 5637.
>     bash5$ ls -lh /tmp/b.ext2
>     -rw-r--r-- 1 twb twb 0 2022-02-16 16:12 /tmp/b.ext2
> 
> It looks like File::Find has a "no_chdir" argument.
> Maybe you just need to pass that?
> 
>     
> https://sources.debian.org/src/perl/5.34.0-3/ext/File-Find/lib/File/Find.pm/#L282
>     
> https://sources.debian.org/src/perl/5.34.0-3/ext/File-Find/lib/File/Find.pm/#L273
> 
> I guess this is happening because approx_disk_usage runs inside an 
> unshare(2)'d context.
> So the other option might be to shuffle things around so it runs with full 
> privileged.
> But that is probably deeply painful and messy.

thanks, this is now fixed:

https://gitlab.mister-muffin.de/josch/mmdebstrap/commit/489e51a2ebc2785d4828deb5030b71214d09fbad

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to