From 175d6d3dbf9fb7beba940d629163afee38276a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 13 Mar 2003 19:53:43 +0000 Subject: [PATCH] (krb5_kuserok): preserve old behviour of function and return FALSE when there isn't a local account for `luser'. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11707 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/kuserok.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/krb5/kuserok.c b/lib/krb5/kuserok.c index 28af0bcc1..c1155181b 100644 --- a/lib/krb5/kuserok.c +++ b/lib/krb5/kuserok.c @@ -51,6 +51,10 @@ krb5_kuserok (krb5_context context, krb5_error_code ret; krb5_boolean b; + pwd = getpwnam (luser); /* XXX - Should use k_getpwnam? */ + if (pwd == NULL) + return FALSE; + ret = krb5_get_default_realms (context, &realms); if (ret) return FALSE; @@ -78,9 +82,6 @@ krb5_kuserok (krb5_context context, } krb5_free_host_realm (context, realms); - pwd = getpwnam (luser); /* XXX - Should use k_getpwnam? */ - if (pwd == NULL) - return FALSE; snprintf (buf, sizeof(buf), "%s/.k5login", pwd->pw_dir); f = fopen (buf, "r"); if (f == NULL)