Le ven 2006-07-14 a 18:09:10 -0400, Nicolas François <[EMAIL PROTECTED]> a dit: > Hello, > > Thanks to Simone's answers on jabber, we could identify a possible cause > for this bug. > > It seems this issue is related to using getpwnam on an LDAP system. > > perl -e 'open(STDIN,"< debian/changelog") || die "error1"; > open(P,"tail -n 40 |") || die "error2"; > close(P); print "status: $?\n"' > > works (i.e. the status is 0). > > but perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); > open(STDIN,"< debian/changelog") || die "error1"; > open(P,"tail -n 40 |") || die "error2"; > close(P); print "status: $?\n"' > > does not always work (sometimes the status is 13, sometime it is 0; nscd may > help). > This could be reproduced on another LDAP system (other than Simone's one). > > Simone, I forgot to ask you if you're using nscd. > > Simon, do you also have an LDAP system? Do you use nscd?
yes. no, due to that it often causes unneeded issues. no caching. > What's the output of: > perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); > open(STDIN,"< debian/changelog") || die "error1"; > open(P,"tail -n 40 |") || die "error2"; > print "status1: $?\n"; > close(P); print "status2: $?\n"' SET 1 ================ (2006.07.14)(pts/6)(18:39) (~/src/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 |") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/6)(18:41) (~/src/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 |") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 (2006.07.14)(pts/6)(18:41) (~/src/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 |") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 (2006.07.14)(pts/6)(18:41) (~/src/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 |") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 =============== once cached by the system, it's ok. nscd currently running. SET 2 =============== (2006.07.14)(pts/6)(18:43) (~/src/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 |") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 (2006.07.14)(pts/6)(18:43) (~/src/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 |") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 =============== these 2 are with no nscd running. nscd in the past didn't work very well. on the machine i'm testing it on it would always get disconnected. this is besides the point though. SET 3 =============== (2006.07.14)(pts/2)(18:46) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/2)(18:46) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/2)(18:46) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/2)(18:46) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/2)(18:46) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % pidof nscd 3825 =========== another box.... the original the bug applies to. SET 4 ========== (2006.07.14)(pts/2)(18:47) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % pidof nscd [1] 13749 exit 1 pidof nscd (2006.07.14)(pts/2)(18:47) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED])[1] % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/2)(18:47) (~/build/kernel/linux-2.6.17) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 ============== same box. the first is a PPC beige g3, running sid, with a slapd running on it, the 2nd is an x86 with it doing lookupѕ to one of 2 machines on the LAN. SET 5 ============== (2006.07.14)(pts/0)(18:48) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/0)(18:49) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 (2006.07.14)(pts/0)(18:49) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/0)(18:49) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 (2006.07.14)(pts/0)(18:49) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 13 (2006.07.14)(pts/0)(18:49) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 (2006.07.14)(pts/0)(18:49) (/usr/src/linux-2.6.16.5) ([EMAIL PROTECTED]) % perl -e '@foo=getpwnam ($ENV{'LOGNAME'}); open(STDIN,"< debian/changelog") || die "error1"; open(P,"tail -n 40 | ") || die "error2"; print "status1: $?\n"; close(P); print "status2: $?\n"' status1: 0 status2: 0 ============ another box, another PPC. similar results as to SET 4 but with nscd stopped. FYI, all the machines in question are VERY similarly configured WRT nscd, nss_ldap and pam_ldap, except 2 of them run a slapd. the beige is the only one where i get a consistently stable error 0, even with nscd running (except for the oldest lookup to nscd where i get an error 13 the first time then 0 afterwards). > I don't know whether it is: > * a dpkg bug > * a perl bug > * an LDAP bug > * an LDAP configuration issue probably a bit of 3, 4 and 2 (4 being as likely as 3 because of the similarity of configuration). dpkg being dependent on perl like it is.. heh. my 2 cents simon > perl and libnss-ldap maintainers, do you have an opinion? > > Thanks in advance, > -- > Nekral -- Heard on 'The daily Show': Interviewee: you have to have certain values to wear this blue shirt at Best Buy." Demetri Martin: "Yeah, a torso." -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]