You are not logged in.
hello,
when i let makepkg unzip a source zip-package all permissions are messed up and set to 755.
but when i unzip same package by hand ("unzip xxx.zip") permissions are kept.
has anyone also noticed this?
vlad
Last edited by DonVla (2008-03-05 13:20:14)
Offline
What happens when you use bsdtar -xvf instead of unzip ?
What is your umask, and which makepkg (pacman) version are you using?
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Offline
Maybe you could report the issue to bsdtar developer.
http://people.freebsd.org/~kientzle/libarchive/
Comments, questions, patches: kientzle@freebsd.org
Give him the os used, libarchive / bsdtar versions and simple instructions how to reproduce the problem.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
hi,
i'll send him a mail today.
but is this not also a makepkg issue?
makepkg uses bsdtar and not preserving file permissions is a quite major flaw.
one can workaround this in a PKGBUILD, but i think that's not really the intention.
vlad
Offline
Are you sure it's not a bad zip file? A lot of zips come from windows machines, which means all permissions will be 755
Offline
that's a point, but as i said unzip (the application) seems to keep permissions right. i do not have much zip archives here to do more testing. i guess i try some more.
vlad
ps: it may be that unzip uses the default umask settings...
pps: i think that's it, unzip uses the umask settings, bsdtar actually keeps the permissions. i've tried 2 other zip files and the bsdar-unpacked files are all 755 and the unzipped files are 644.
Last edited by DonVla (2008-03-06 22:41:05)
Offline
Give us an example.
Improve your desktop responsiveness and font rendering and ALSA sound and BusyBox init
Offline
hi,
take any zip file,
e.g. http://www.epsxe.com/files/epsxe160lin.zip
vlad
Offline
As a normal user, both unzip epsxe160lin.zip and bsdtar -xvf epsxe160lin.zip show:
$ ll sstates/kill.me
-rwxr-xr-x 1 brebs brebs 27 2002-01-27 23:03 sstates/kill.me
$ umask
0022Make sure you have libarchive 2.4.12-1
Improve your desktop responsiveness and font rendering and ALSA sound and BusyBox init
Offline
That's strange, I didn't have any problems reproducing the problem
1) echo foo > foo
2) echo bar > bar
3) chmod 640 foo
4) chmod 400 bar
5) zip test.zip foo bar
6) mkdir test1 test2
7) unzip test.zip -d test1
8) bsdtar -xvf test.zip -C test2
9) ls -l test1 test2
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
OK, that shows a discrepancy:
$ ls -l test1 test2
test1:
total 8
-r-------- 1 brebs brebs 4 2008-03-07 18:36 bar
-rw-r----- 1 brebs brebs 4 2008-03-07 18:35 foo
test2:
total 8
-rwxr-xr-x 1 brebs brebs 4 2008-03-07 18:36 bar
-rwxr-xr-x 1 brebs brebs 4 2008-03-07 18:35 fooImprove your desktop responsiveness and font rendering and ALSA sound and BusyBox init
Offline
Donvla said he would send a mail, but apparently he did not. Or at least he didn't share the answer with us.
I finally decided to send a mail earlier today, and this evening I already had the answer, that guy is amazing ![]()
As it turns out, "bsdtar -tvf test.zip" does not
show the permissions, due to a basic architectural
trade-off:
* bsdtar can extract arbitrarily large zip archives from stdin:
cat test.zip | tar -tvf -
* unzip can extract permission data written by Info-ZipThe core problem here is that Info-Zip only stores
permission information at the end of the archive.
As a result, in order to use that information
you must be able to read the end of the archive
first, before you extract any of the data.
unzip always reads the end of the archive first,
which is why it cannot read from stdin. bsdtar
always streams the archive data, so it cannot
read the permission data before extracting the
file.A few of the libarchive developers have been
tossing around ideas for allowing bsdtar to
read the end-of-file archive information from
Zip archives if the archive happens to be
stored in a seekable file. That would give the
best of both worlds.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline