Skip to content

Commit

Permalink
Handle directory replaced with a symlink to one in verify (RhBug:1101…
Browse files Browse the repository at this point in the history
…861)

- An unforced installation must not cause verification failures - we
  permit directories to be replaced by directory symlinks during
  install so we need to do the same in verify too.
  • Loading branch information
pmatilai committed Sep 24, 2014
1 parent 00b336b commit 3ccd774
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi,
return 1;
}

/* If we expected a directory but got a symlink to one, follow the link */
if (S_ISDIR(fmode) && S_ISLNK(sb.st_mode) && stat(fn, &sb) != 0) {
*res |= RPMVERIFY_LSTATFAIL;
return 1;
}

/* Links have no mode, other types have no linkto */
if (S_ISLNK(sb.st_mode))
flags &= ~(RPMVERIFY_MODE);
Expand Down

0 comments on commit 3ccd774

Please sign in to comment.