mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-13 05:41:26 +01:00
Instead of ignoring the EEXIST from link(), unconditionally unlink
the terget before calling link(). This should prevent links to an old copy of the file from being retained.
This commit is contained in:
parent
aa60f7a6de
commit
e4efa066e1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299589
@ -422,9 +422,11 @@ process_page(char *mandir, char *src, char *cat, enum Ziptype zipped)
|
||||
fprintf(stderr, "%slink %s -> %s\n",
|
||||
verbose ? "\t" : "", cat, link_name);
|
||||
}
|
||||
if (!pretend)
|
||||
if (link(link_name, cat) < 0 && errno != EEXIST)
|
||||
if (!pretend) {
|
||||
(void) unlink(cat);
|
||||
if (link(link_name, cat) < 0)
|
||||
warn("%s %s: link", link_name, cat);
|
||||
}
|
||||
return;
|
||||
}
|
||||
insert_hashtable(links, src_ino, src_dev, strdup(cat));
|
||||
|
Loading…
Reference in New Issue
Block a user