From: Peter Howkins Date: Thu, 19 Apr 2012 16:16:50 +0000 (+0100) Subject: On the gneeric authenticator use shadow password API if under linux, X-Git-Tag: 2.2.0a~26^2~43 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=de621b906bc7751a8ae62aeb0605e3eb669ed218;p=oweals%2Fcde.git On the gneeric authenticator use shadow password API if under linux, allows login on dtlogin. --- diff --git a/cde/programs/dtlogin/sysauth.c b/cde/programs/dtlogin/sysauth.c index 8c5bff65..b6389104 100644 --- a/cde/programs/dtlogin/sysauth.c +++ b/cde/programs/dtlogin/sysauth.c @@ -135,6 +135,10 @@ #include #endif +#if defined(linux) +# include +#endif + #ifdef __hpux /*************************************************************************** * @@ -2414,6 +2418,18 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg ) p = getpwnam(name); +#if defined(linux) + /* + * Use the Linux Shadow Password system to get the crypt()ed password + */ + if(p) { + struct spwd *s = getspnam(name); + if(s) { + p->pw_passwd = s->sp_pwdp; + } + } +#endif + if (!p || strlen(name) == 0 || strcmp (crypt (passwd, p->pw_passwd), p->pw_passwd)) {