From c5212baa23d80898e7f71057e1bfa93035b90630 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 5 Jun 1996 08:21:49 +0000 Subject: [PATCH] Use `verify_unix_user' git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@561 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/xnlock/xnlock.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index 4a7cec24d..d00c22721 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -521,21 +521,6 @@ countdown(XtPointer _t, XtIntervalId *_d) return; } -static int -verify_unix(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; -} - static int verify(char *password) { @@ -545,7 +530,7 @@ verify(char *password) * First try with root password, if allowed. */ - if(appres.accept_root && verify_unix("root", password) == 0) + if(appres.accept_root && verify_unix_user("root", password) == 0) return 0; /* * Password that log out user @@ -582,7 +567,7 @@ verify(char *password) /* * Try to verify as user. */ - if(verify_unix(name, password) == 0) + if(verify_unix_user(name, password) == 0) return 0; return -1; }