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 <lukem@NetBSD.org> git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14838 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -125,7 +125,7 @@ doauth(SIAENTITY *entity, int pkgind, char *name)
|
|||||||
int secure;
|
int secure;
|
||||||
#endif
|
#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));
|
SIA_DEBUG(("DEBUG", "failed to getpwnam(%s)", name));
|
||||||
return SIADFAIL;
|
return SIADFAIL;
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ doauth(SIAENTITY *entity, int pkgind, char *name)
|
|||||||
#else
|
#else
|
||||||
ouid = getuid();
|
ouid = getuid();
|
||||||
#endif
|
#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));
|
SIA_DEBUG(("DEBUG", "failed to getpwuid(%u)", ouid));
|
||||||
return SIADFAIL;
|
return SIADFAIL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user