added basic checking of user and groups. this does it by [GU]ID only
authorroot <devnull@localhost>
Thu, 29 Feb 1996 02:07:47 +0000 (02:07 +0000)
committerroot <devnull@localhost>
Thu, 29 Feb 1996 02:07:47 +0000 (02:07 +0000)
CVS patchset: 438
CVS date: 1996/02/29 02:07:47

lib/verify.c

index ce70331..ba87777 100644 (file)
@@ -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;
 }