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:
parent
bc96e6f1ff
commit
de621b906b
1 changed files with 16 additions and 0 deletions
|
@ -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)) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue