summaryrefslogtreecommitdiff
path: root/lib/verify.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1997-05-15 14:00:44 +0000
committerewt <devnull@localhost>1997-05-15 14:00:44 +0000
commitc6aac8432921d5c5586cb29f81cd85831a473e75 (patch)
treedab4b284cf2fafe2828ac817cb38101f07bc3303 /lib/verify.c
parent9b93a43a010691c149a811e2480c12bcb2d58c17 (diff)
downloadlibrpm-tizen-c6aac8432921d5c5586cb29f81cd85831a473e75.tar.gz
librpm-tizen-c6aac8432921d5c5586cb29f81cd85831a473e75.tar.bz2
librpm-tizen-c6aac8432921d5c5586cb29f81cd85831a473e75.zip
Don't segv if we can't do a uid to uname conversion
CVS patchset: 1626 CVS date: 1997/05/15 14:00:44
Diffstat (limited to 'lib/verify.c')
-rw-r--r--lib/verify.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/verify.c b/lib/verify.c
index 4d8a011b1..13db7a387 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -31,6 +31,7 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result,
unsigned short * modeList, * rdevList;
char * fileStatesList;
char * filespec;
+ char * name;
int type, count, rc;
struct stat sb;
unsigned char md5sum[40];
@@ -167,7 +168,8 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result,
if (flags & RPMVERIFY_USER) {
if (headerGetEntry(h, RPMTAG_FILEUSERNAME, NULL, (void **) &unameList,
NULL)) {
- if (strcmp(unameList[filenum], uidToUname(sb.st_uid)))
+ name = uidToUname(sb.st_uid);
+ if (!name || strcmp(unameList[filenum], name))
*result |= RPMVERIFY_USER;
free(unameList);
} else if (headerGetEntry(h, RPMTAG_FILEUIDS, NULL, (void **) &uidList,
@@ -184,7 +186,8 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result,
if (flags & RPMVERIFY_GROUP) {
if (headerGetEntry(h, RPMTAG_FILEGROUPNAME, NULL, (void **) &gnameList,
NULL)) {
- if (strcmp(gnameList[filenum], gidToGname(sb.st_gid)))
+ name = gidToGname(sb.st_uid);
+ if (!name || strcmp(gnameList[filenum], name))
*result |= RPMVERIFY_GROUP;
free(gnameList);
} else if (headerGetEntry(h, RPMTAG_FILEGIDS, NULL, (void **) &gidList,