Check the shadow password under Haiku, when available. ftpd works again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25129 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-04-24 16:07:59 +00:00
parent d1dc42cc73
commit dcc3839464

View File

@ -99,6 +99,10 @@ __FBSDID("$FreeBSD: src/libexec/ftpd/ftpd.c,v 1.212 2007/04/18 22:43:39 yar Exp
#include <security/pam_appl.h>
#endif
#ifdef __HAIKU__
#include <shadow.h>
#endif
#include "pathnames.h"
#include "extern.h"
@ -968,9 +972,18 @@ sgetpwnam(char *name)
{
static struct passwd save;
struct passwd *p;
#ifdef __HAIKU__
struct spwd *sp = NULL;
#endif
if ((p = getpwnam(name)) == NULL)
return (p);
#ifdef __HAIKU__
if (strcmp(p->pw_passwd, "x") == 0) {
if ((sp = getspnam(name)) == NULL)
return (p);
}
#endif
if (save.pw_name) {
free(save.pw_name);
free(save.pw_passwd);
@ -980,6 +993,11 @@ sgetpwnam(char *name)
}
save = *p;
save.pw_name = sgetsave(p->pw_name);
#ifdef __HAIKU__
if (sp)
save.pw_passwd = sgetsave(sp->sp_pwdp);
else
#endif
save.pw_passwd = sgetsave(p->pw_passwd);
save.pw_gecos = sgetsave(p->pw_gecos);
save.pw_dir = sgetsave(p->pw_dir);