When the /var/lib/apt/lists/* files are not readable by the current user, apt-cache segfaults and dumps core. This is from apt 0.5.3 on ia32 (woody).
The tail-end of an strace shows:
access("/var/cache/apt/", W_OK) = -1 EACCES (Permission denied)
stat64(0x8055e70, 0xbffff62c) = 0
open("/var/cache/apt/pkgcache.bin", O_RDONLY) = -1 EACCES (Permission denied)
fstat64(0xffffffff, 0xbffff5bc) = -1 EBADF (Bad file descriptor)
old_mmap(NULL, 6295552, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40265000
stat64(0x8055e40, 0xbffff62c) = 0
open("/var/cache/apt/srcpkgcache.bin", O_RDONLY) = -1 EACCES (Permission denied)
fstat64(0xffffffff, 0xbffff5bc) = -1 EBADF (Bad file descriptor)
stat64(0x8057158, 0xbffff68c) = 0
stat64(0x8057288, 0xbffff68c) = 0
stat64(0x8057288, 0xbffff68c) = 0
stat64(0x8056f90, 0xbffff68c) = 0
stat64(0x8056f90, 0xbffff68c) = 0
stat64(0x8056f90, 0xbffff68c) = 0
stat64(0x8055c90, 0xbffff6cc) = 0
stat64(0x8057158, 0xbffff63c) = 0
stat64(0x8057158, 0xbffff65c) = 0
open("/var/lib/apt/lists/ftp.au.debian.org_pub_debian_dists_testing_main_binary-i386_Packages",
O_RDONLY) = -1 EACCES (Permission denied)
munmap(0x40265000, 6295552) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
I don't have the source to hand but I'm sure it's something trivial.
Doing a "chmod -R a+r /var/cache/apt /var/lib/apt" fixes everything, but
it'd be better if apt-cache politely complained rather than falling in a
heap. As I change my systems' root umask to 077 rather than 022, I find I
get bitten by these sorts of things often, where programs are going to
assume that something is readable. Perhaps apt-get should explicitly set
the modes on the files it creates?
Andrew.
--
Andrew Shugg <[EMAIL PROTECTED]> http://www.neep.com.au/
"Just remember, Mr Fawlty, there's always someone worse off than yourself."
"Is there? Well I'd like to meet him. I could do with a good laugh."
pgpR12tmBMlah.pgp
Description: PGP signature

