summaryrefslogtreecommitdiffstats
path: root/sbin/restore
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1997-08-10 14:19:13 +0000
committerjoerg <joerg@FreeBSD.org>1997-08-10 14:19:13 +0000
commitb350688b281b089b301d8f78952b1025907bba9e (patch)
tree4de40a616705d9a3994d6af4e0d88e6260e33664 /sbin/restore
parentd50ebd355c62e98b100d823a37ca58eb8a7a93c6 (diff)
downloadFreeBSD-src-b350688b281b089b301d8f78952b1025907bba9e.zip
FreeBSD-src-b350688b281b089b301d8f78952b1025907bba9e.tar.gz
If, in a level N dump, the file with the inode number X is a
non-directory file with more than one link to it, but in a level M > N dump, the file with the inode number X is a plain file, "restore", when restoring the level M dump, won't remove all the hard links to the old file. Submitted by: guy@netapp.com (Guy Harris)
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/restore.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c
index 936d857..4da97f1 100644
--- a/sbin/restore/restore.c
+++ b/sbin/restore/restore.c
@@ -428,8 +428,12 @@ nodeupdates(name, ino, type)
}
if (ip->e_type == LEAF) {
/* changing from leaf to node */
- removeleaf(ip);
- freeentry(ip);
+ for (ip = lookupino(ino); ip != NULL; ip = ip->e_links) {
+ if (ip->e_type != LEAF)
+ badentry(ip, "NODE and LEAF links to same inode");
+ removeleaf(ip);
+ freeentry(ip);
+ }
ip = addentry(name, ino, type);
newnode(ip);
} else {
OpenPOWER on IntegriCloud