reassign 326986 perl,libnss-ldap
retitle 326986 getpwnam fails if libnss-ldap.conf is not readable
thanks

On Wed, 2005-09-07 at 10:30 -0700, Aaron T Porter wrote:
> On Wed, Sep 07, 2005 at 01:09:22PM +0100, Scott James Remnant wrote:
> > On Tue, 2005-09-06 at 17:46 -0700, Aaron T Porter wrote:
> > 
> > > Further digging shows an error reading /etc/libnss-ldap.conf,
> > > opening up permissions to this file produces the expected output from
> > > dpkg-architecture. This file does however contain an ldap bind password
> > > that would be best kept private.
> > > 
> > What is reading this file?  dpkg-architecture doesn't itself.
> 
>       Seems to be perl's getwnam on line 56 of
> /usr/lib/dpkg/controllib.pl. This makes no sense to me, as that seems to
> return valid data. However simply replacing the line with a hand generated
> array makes things work:
> 
> if (defined ($ENV{'LOGNAME'})) {
> #    @fowner = getpwnam ($ENV{'LOGNAME'});
>      @fowner = { "atporter","foo","21002","124"};
>     if (! @fowner) { die (sprintf ('unable to get login information for 
> username "%s"', $ENV{'LOGNAME'})); }
> }
> 
> The following produces the same output both as a non root user (where I
> still see the error on libnss-ldap.conf) and as root:
> 
> @fowner = getpwnam ("atporter");
> @fowner = @fowner[2,3];
> 
> for (@fowner) {
> print "$_\n";
> }
> 
It's either a Perl or libnss-ldap problem then.

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to