Adjusted to work with shadow passwords.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25056 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-04-19 17:43:38 +00:00
parent 2e4a383953
commit ac018c2ffa
2 changed files with 11 additions and 7 deletions

View File

@ -6,12 +6,14 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
#UsePrivateHeaders tracker ;
#SubDirHdrs $(HAIKU_TOP) src kits tracker ;
UseHeaders [ FDirName $(HAIKU_TOP) src bin multiuser ] ;
Application Login :
LoginApp.cpp
LoginWindow.cpp
LoginView.cpp
main.cpp
: be tracker
: be tracker libmultiuser_utils.a
: Login.rdef
;
;

View File

@ -3,10 +3,14 @@
#include <stdio.h>
#include <unistd.h>
#include <pwd.h>
#include <shadow.h>
#include "LoginApp.h"
#include "LoginWindow.h"
#include "multiuser_utils.h"
const char *kLoginAppSig = "application/x-vnd.Haiku-Login";
@ -98,11 +102,9 @@ LoginApp::ValidateLogin(const char *login, const char *password/*, bool force =
return B_OK;
}
// XXX: check for shadow pass
if (strcmp(crypt(password, pwd->pw_passwd), pwd->pw_passwd))
return B_NOT_ALLOWED;
return B_OK;
if (verify_password(pwd, getspnam(login), password))
return B_OK;
return B_NOT_ALLOWED;
}