Package: apt-cacher
Version: 1.4.1
Severity: normal
Tags: patch
apt-cacher can no longer be run when configured for user/group root.
getgrnam & getpwnam calls return the undefined value if the entity cannot be
found, not zero. Zero would be a legitimate value, when using root, so you need
to check for undefined value rather than just !returnedvalue
Trivial patch attached.
Richard.
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages apt-cacher depends on:
ii bzip2 1.0.2-11 high-quality block-sorting file co
ii libwww-perl 5.803-4 WWW client/server library for Perl
ii perl 5.8.7-10 Larry Wall's Practical Extraction
apt-cacher recommends no packages.
-- no debconf information
--- /usr/sbin/apt-cacher.orig 2006-01-15 12:40:27.000000000 +0000
+++ /usr/sbin/apt-cacher 2006-01-15 12:40:49.000000000 +0000
@@ -391,7 +391,7 @@
}
else {
$gid=getgrnam($gid);
- die "No such group (exiting)\n" if !$gid;
+ die "No such group (exiting)\n" if !defined($gid);
}
$) = $gid;
$( = $gid;
@@ -405,7 +405,7 @@
}
else {
$uid=getpwnam($uid);
- die "No such user (exiting)\n" if !$uid;
+ die "No such user (exiting)\n" if !defined($uid);
}
$> = $uid;
$< = $uid;