Better support for shadow passwords.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@816 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -31,7 +31,8 @@ SHLIBEXT = @SHLIBEXT@
|
||||
SHARED = @SHARED@
|
||||
LIB = $(LIBNAME).$(LIBEXT)
|
||||
|
||||
OBJECTS = k_getpwnam.o signal.o tm2time.o verify.o inaddr2str.o mini_inetd.o \
|
||||
OBJECTS = k_getpwuid.o k_getpwnam.o signal.o tm2time.o \
|
||||
verify.o inaddr2str.o mini_inetd.o \
|
||||
@LIBOBJS@
|
||||
|
||||
all: $(LIB)
|
||||
|
28
lib/roken/k_getpwuid.c
Normal file
28
lib/roken/k_getpwuid.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#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;
|
||||
}
|
||||
#endif
|
||||
return p;
|
||||
}
|
@@ -82,6 +82,7 @@ char *getstr(char *id, char **cpp);
|
||||
|
||||
#include <pwd.h>
|
||||
struct passwd *k_getpwnam (char *user);
|
||||
struct passwd *k_getpwuid (uid_t uid);
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
@@ -82,6 +82,7 @@ char *getstr(char *id, char **cpp);
|
||||
|
||||
#include <pwd.h>
|
||||
struct passwd *k_getpwnam (char *user);
|
||||
struct passwd *k_getpwuid (uid_t uid);
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
Reference in New Issue
Block a user