From: root Date: Thu, 29 Feb 1996 02:07:47 +0000 (+0000) Subject: added basic checking of user and groups. this does it by [GU]ID only X-Git-Tag: tznext/4.11.0.1.tizen20130304~11522 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cf0beea9fa01d84671291c8af7db311fa89409e;p=tools%2Flibrpm-tizen.git added basic checking of user and groups. this does it by [GU]ID only CVS patchset: 438 CVS date: 1996/02/29 02:07:47 --- diff --git a/lib/verify.c b/lib/verify.c index ce70331..ba87777 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -19,6 +19,7 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) { unsigned char md5sum[40]; char linkto[1024]; int size; + int_32 * uidList, * gidList; getEntry(h, RPMTAG_FILEMODES, &type, (void **) &modeList, &count); @@ -93,6 +94,16 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) { if (mtimeList[filenum] != sb.st_mtime) *result |= VERIFY_MTIME; } + if (flags & VERIFY_USER) { + getEntry(h, RPMTAG_FILEUIDS, &type, (void **) &uidList, &count); + if (uidList[filenum] != sb.st_uid) + *result |= VERIFY_USER; + } + if (flags & VERIFY_GROUP) { + getEntry(h, RPMTAG_FILEGIDS, &type, (void **) &gidList, &count); + if (gidList[filenum] != sb.st_gid) + *result |= VERIFY_GROUP; + } return 0; }