Files
heimdal/lib/roken/k_getpwuid.c
Assar Westerlund 4a57937249 Call `endpwent'. If we are using a BSD-kind of system we should not leave the shadow password database open.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@823 ec53bebd-3082-4978-b11e-865c3cabbd6b
1996-10-02 18:42:12 +00:00

32 lines
453 B
C

#ifdef HAVE_CONFIG_H
#include <config.h>
RCSID("$Id$");
#endif /* HAVE_CONFIG_H */
#include "roken.h"
#ifdef HAVE_SHADOW_H
#include <shadow.h>
#endif
struct passwd *
k_getpwuid (uid_t uid)
{
struct passwd *p;
p = getpwuid (uid);
#ifdef HAVE_GETSPUID
if (p)
{
struct spwd *spwd;
spwd = getspuid (uid);
if (spwd)
p->pw_passwd = spwd->sp_pwdp;
endspent ();
}
#else
endpwent ();
#endif
return p;
}