When extracting a 7z archive to an output directory which does not yet exist, 7zr creates this directory automatically. While for all files and directories within the archive, the default umask modes are applied, the parent output directory is created always with 0700 mode. As this is different with all other tested packagers (tar, unzip) and at least IMO not expected or convenient, I suggest to respect the umask for the newly created parent directory as well. To replicate: ------- > testfile 7zr a testarchive.7z testfile 7zr x testarchive.7z -otestdir ls -al testdir ------- The same is true for the following package versions: - 16.02+dfsg-6 (Buster) - 16.02+dfsg-3+deb9u1 (Stretch) And it is true for the 7za and 7z commands, shipped with the p7zip-full package. I also tested the alpha version of the new official 7-Zip Linux binaries (7zz), which are compatible regarding command arguments and options, where the issue does not exist: https://sourceforge.net/p/sevenzip/discussion/45797/thread/cec5e63147/ Best regards, Micha
This bug was reported *13 years ago* on Sourceforge and ignored: https://sourceforge.net/p/p7zip/bugs/87/ I reported it again today but I am not holding my breath for the developer to fix it. It would be great to see this simple patch added by the maintainer.
Thanks for the link with the contained patch. Bumping this as it still would be great to see it merged:------- diff FileDir.cpp FileDir_fix.cpp 569c569 < if (mkdir( name, 0700 ) == 0) bret = true; --- > if (mkdir( name, 0777 & gbl_umask.mask ) == 0) bret = true; ------- Best regards, Micha