Bug 51312 - getpwuid() fails for uid=0 and uid=500
getpwuid() fails for uid=0 and uid=500
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: kdbg (Show other bugs)
7.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-09 08:42 EDT by Need Real Name
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-10-08 11:43:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
debug material for bug 51312 (4.02 KB, text/plain)
2001-08-09 08:44 EDT, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2001-08-09 08:42:18 EDT
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 08:44:16 EDT
Created attachment 26993 [details]
debug material for bug 51312
Comment 2 Jakub Jelinek 2001-08-09 08:59:13 EDT
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 09:22:53 EDT
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 10:19:58 EDT
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 10:25:21 EDT
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 17:46:36 EDT
We (Red Hat) should really try to this this before next release.
Comment 7 Bernhard Rosenkraenzer 2001-08-27 10:04:04 EDT
Please attach the code that fails.
Comment 8 Need Real Name 2001-09-07 09:47:54 EDT
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 11:43:16 EDT
I just tried it with kdbg here; I broke at main and stepped over all function
calls. It worked fine.

Note You need to log in before you can comment on or make changes to this bug.