fixed symlink verification
authorewt <devnull@localhost>
Tue, 20 Feb 1996 21:53:44 +0000 (21:53 +0000)
committerewt <devnull@localhost>
Tue, 20 Feb 1996 21:53:44 +0000 (21:53 +0000)
CVS patchset: 365
CVS date: 1996/02/20 21:53:44

lib/verify.c

index b5bd119..ce70331 100644 (file)
@@ -65,11 +65,12 @@ int rpmVerifyFile(char * prefix, Header h, int filenum, int * result) {
     } 
     if (flags & VERIFY_LINKTO) {
        getEntry(h, RPMTAG_FILELINKTOS, &type, (void **) &linktoList, &count);
-       if ((size = readlink(filespec, linkto, sizeof(linkto))))
+       size = readlink(filespec, linkto, sizeof(linkto));
+       if (size == -1)
            *result |= VERIFY_LINKTO;
        else 
-           filespec[size] = '\0';
-           if (strcmp(filespec, linktoList[filenum]))
+           linkto[size] = '\0';
+           if (strcmp(linkto, linktoList[filenum]))
                *result |= VERIFY_LINKTO;
        free(linktoList);
     }