1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

On the gneeric authenticator use shadow password API if under linux,

allows login on dtlogin.
This commit is contained in:
Peter Howkins 2012-04-19 17:16:50 +01:00
parent bc96e6f1ff
commit de621b906b

View file

@ -135,6 +135,10 @@
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#endif #endif
#if defined(linux)
# include <shadow.h>
#endif
#ifdef __hpux #ifdef __hpux
/*************************************************************************** /***************************************************************************
* *
@ -2414,6 +2418,18 @@ Authenticate( struct display *d, char *name, char *passwd, char **msg )
p = getpwnam(name); 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 || if (!p || strlen(name) == 0 ||
strcmp (crypt (passwd, p->pw_passwd), p->pw_passwd)) { strcmp (crypt (passwd, p->pw_passwd), p->pw_passwd)) {