From 1caed238c50a75f30cf8f6975836b71872472281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 19 Apr 2005 04:41:07 +0000 Subject: [PATCH] fix getpw*_r calls, they return 0 even when the entry isn't found and instead make it with setting return pointer to NULL. From Luke Mewburn git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14838 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/auth/sia/sia.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/auth/sia/sia.c b/lib/auth/sia/sia.c index 6355ecac7..eb0e8303c 100644 --- a/lib/auth/sia/sia.c +++ b/lib/auth/sia/sia.c @@ -125,7 +125,7 @@ doauth(SIAENTITY *entity, int pkgind, char *name) int secure; #endif - if(getpwnam_r(name, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0){ + if(getpwnam_r(name, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0 || pwd == NULL){ SIA_DEBUG(("DEBUG", "failed to getpwnam(%s)", name)); return SIADFAIL; } @@ -162,7 +162,7 @@ doauth(SIAENTITY *entity, int pkgind, char *name) #else ouid = getuid(); #endif - if(getpwuid_r(ouid, &fpw, fpwbuf, sizeof(fpwbuf), &fpwd) != 0){ + if(getpwuid_r(ouid, &fpw, fpwbuf, sizeof(fpwbuf), &fpwd) != 0 || fpwd == NULL){ SIA_DEBUG(("DEBUG", "failed to getpwuid(%u)", ouid)); return SIADFAIL; }