From 71635eb47aed00576ba602981c51596b3fd4b203 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Fri, 15 Mar 1996 06:28:23 +0000 Subject: [PATCH] Added shadow password support git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7640 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ftpd/ChangeLog | 4 ++++ src/appl/gssftp/ftpd/configure.in | 13 +++++++++++++ src/appl/gssftp/ftpd/ftpd.c | 13 +++++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 010009f4b..1759aa776 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,7 @@ +Fri Mar 15 01:24:39 1996 Richard Basch + + * configure.in, ftpd.c: Added shadow password support. + Fri Feb 16 15:51:59 1996 Mark Eichin * ftpcmd.y (yylex): error handling changes from kbalk@hp.com. diff --git a/src/appl/gssftp/ftpd/configure.in b/src/appl/gssftp/ftpd/configure.in index 2f60d9081..f7e4c8739 100644 --- a/src/appl/gssftp/ftpd/configure.in +++ b/src/appl/gssftp/ftpd/configure.in @@ -27,6 +27,19 @@ SETENVOBJ=setenv.o AC_SUBST([SETENVSRC]) AC_SUBST([SETENVOBJ]) fi +AC_MSG_CHECKING([shadow password support]) +AC_CACHE_VAL(krb5_cv_shadow_pwd, +[AC_TRY_LINK( +[#include +#include +#include ], +[struct spwd *sp = getspnam("root")], +krb5_cv_shadow_pwd=yes, krb5_cv_shadow_pwd=no)]) +AC_MSG_RESULT($krb5_cv_shadow_pwd) +if test $krb5_cv_shadow_pwd = yes; then +AC_DEFINE(HAVE_SHADOW) +fi +dnl dnl USE_ANAME KRB5_LIBRARIES diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index cb531ce82..6f3e9cf06 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -65,6 +65,9 @@ static char sccsid[] = "@(#)ftpd.c 5.40 (Berkeley) 7/2/91"; #include #include #include +#ifdef HAVE_SHADOW +#include +#endif #include #include #include @@ -468,6 +471,9 @@ sgetpwnam(name) { static struct passwd save; register struct passwd *p; +#ifdef HAVE_SHADOW + register struct spwd *sp; +#endif char *sgetsave(); if ((p = getpwnam(name)) == NULL) @@ -481,7 +487,14 @@ sgetpwnam(name) } save = *p; save.pw_name = sgetsave(p->pw_name); +#ifdef HAVE_SHADOW + if ((sp = getspnam(name)) == NULL) + save.pw_passwd = sgetsave(p->pw_passwd); + else + save.pw_passwd = sgetsave(sp->sp_pwdp); +#else save.pw_passwd = sgetsave(p->pw_passwd); +#endif save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); -- 2.26.2