[ale] problems with getpwent()
Chris Fowler
ChrisF at computone.com
Mon Mar 5 16:56:13 EST 2001
I've
seemed to have missed /etc/nsswitch.conf
<SPAN
class=437114721-05032001>Â
<SPAN
class=437114721-05032001>getpwent() retuens NULL and errno is set to
Success.   anyone have any thoughts?
<SPAN
class=437114721-05032001>Â
<SPAN
class=437114721-05032001>Chris
<SPAN
class=437114721-05032001>Â
<FONT face=Tahoma
size=2>-----Original Message-----From: Chris Fowler
[mailto:ChrisF at computone.com]Sent: Monday, March 05, 2001 4:42
PMTo: 'ale at ale.org'Subject: [ale] problems with
getpwent()
Help,
I'm trying to create a small based distribution that will run
over the network onto a development workstation. My base is rdhat 7.0
and I'm having problems
with the passwd program. I do have an /etc/passwd and
everytime I try to runn passwd, I get Can't locate username: No such file or
directory. SO I wrote the small piece of code below to test it and I
error out with "No such file or directory". If I look in /etc there is a
passwd file.
I'm not using shadow nor do I wan to and I'm not use
PAM. I have compile login-utils to not use pam nor shadow. Is
there anything eles the getpwent()
needs?
Thanks, Chris
------- pas.c ----------- #include
<pwd.h> #include <sys/types.h>
#include <unistd.h> #include
<stdio.h>
void main(void) <FONT
size=2>{ Â Â Â Â Â Â Â <FONT
size=2>struct passwd *pass;
       if ((pass =
getpwent()) == NULL) Â Â Â Â Â Â Â
{ Â Â Â Â Â Â Â
       <FONT
size=2>perror("pas.c"); Â Â Â Â Â Â Â
       exit(1);
       }
       <FONT
size=2>printf("pass->pw_name: %s\n",pass->pw_name); <FONT
size=2>}
More information about the Ale
mailing list