#ifdef HAVE_CONFIG_H #include RCSID("$Id$"); #endif #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_CRYPT_H #include #endif #include "roken.h" int unix_verify_user(char *user, char *password) { struct passwd *pw; pw = k_getpwnam(user); if(pw == NULL) return -1; if(strlen(pw->pw_passwd) == 0 && strlen(password) == 0) return 0; if(strcmp(crypt(password, pw->pw_passwd), pw->pw_passwd) == 0) return 0; return -1; }