Bug 51312

Summary: getpwuid() fails for uid=0 and uid=500
Product: [Retired] Red Hat Linux Reporter: Need Real Name <jeweaver>
Component: kdbgAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED WORKSFORME QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-10-08 15:43:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
debug material for bug 51312 none

Description Need Real Name 2001-08-09 12:42:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686)

Description of problem:


How reproducible:
Always

Steps to Reproduce:

See attachment	

Actual Results:  See attachment

Expected Results:  Should have received primed passwd structure

Additional info:

Comment 1 Need Real Name 2001-08-09 12:44:16 UTC
Created attachment 26993 [details]
debug material for bug 51312

Comment 2 Jakub Jelinek 2001-08-09 12:59:13 UTC
Works just fine for me.
What's your content of nsswitch.conf, why you decided to print the
backtrace from _dl_debug_state, does it return NULL or what?

Comment 3 Need Real Name 2001-08-09 13:22:53 UTC
Execution of the pgm stops at the point of failure.

Here's the contents of /etc/nsswitch.conf

#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#	nisplus or nis+		Use NIS+ (NIS version 3)
#	nis or yp		Use NIS (NIS version 2), also called YP
#	dns			Use DNS (Domain Name Service)
#	files			Use the local files
#	db			Use the local database (.db) files
#	compat			Use NIS on compat mode
#	hesiod			Use Hesiod for user lookups
#	[NOTFOUND=return]	Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files nisplus
shadow:     files nisplus
group:      files nisplus

#hosts:     db files nisplus nis dns
hosts:      files nisplus dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files     

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files nisplus
rpc:        files
services:   files nisplus

netgroup:   files nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus


Comment 4 Need Real Name 2001-08-09 14:19:58 UTC
It's looking more like a bug in the KDevelop debugger.  My function A calls a function B which in turn calls getpwuid().  If I set breakpoints on either sided 
of the call to function B and do a "run to cursor" then I don't appear to have any problems.  But if I step into function B and attempt to step over the call to 
getpwuid() or if I step over the call to function B, then the problem occurs.

Comment 5 Need Real Name 2001-08-09 14:25:21 UTC
I appear to have a similar problem with the gethostbyname() api.  Any chance I have some kind of corruption or authority problem that would be causing 
these calls to fail while debugging?

Comment 6 Glen Foster 2001-08-23 21:46:36 UTC
We (Red Hat) should really try to this this before next release.

Comment 7 Bernhard Rosenkraenzer 2001-08-27 14:04:04 UTC
Please attach the code that fails.


Comment 8 Need Real Name 2001-09-07 13:47:54 UTC
Here's a small program that causes the problem when stepping over getpwuid() statement using kdevelop's debugger.    

#include <pwd.h>


int main(int argc, char *argv[])
{
 uid_t nUserID = getuid();
 struct passwd   *pPasswd = NULL;
 pPasswd = (struct passwd *)getpwuid(nUserID);
 return EXIT_SUCCESS;
}


Comment 9 Bill Nottingham 2001-10-08 15:43:16 UTC
I just tried it with kdbg here; I broke at main and stepped over all function
calls. It worked fine.