1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2025-02-13 23:12:47 +01:00

fix auth without shadown

This commit is contained in:
lxsang 2018-10-27 11:23:47 +02:00
parent 6321e984e1
commit ef51f7f700

View File

@ -38,23 +38,23 @@ static int l_check_login (lua_State *L) {
return 1; return 1;
} }
spwd = getspnam(username); spwd = getspnam(username);
if (spwd == NULL) /*if (spwd == NULL)
{ {
lua_pushboolean(L,0); lua_pushboolean(L,0);
printf("no permission to read shadow password file\n"); printf("no permission to read shadow password file\n");
return 1; return 1;
} }*/
if (spwd != NULL) /* If there is a shadow password record */ if (spwd != NULL) /* If there is a shadow password record */
{ {
pwd->pw_passwd = spwd->sp_pwdp; /* Use the shadow password */ pwd->pw_passwd = spwd->sp_pwdp; /* Use the shadow password */
} }
else /*else
{ {
lua_pushboolean(L,0); lua_pushboolean(L,0);
printf("shadow record is null \n" ); printf("shadow record is null \n" );
return 1; return 1;
} }*/
/* Encrypt password and erase cleartext version immediately */ /* Encrypt password and erase cleartext version immediately */
encrypted = crypt(password, pwd->pw_passwd); encrypted = crypt(password, pwd->pw_passwd);
if (encrypted == NULL) if (encrypted == NULL)