diff options
author | joerg <joerg@FreeBSD.org> | 1997-08-10 14:19:13 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-08-10 14:19:13 +0000 |
commit | b350688b281b089b301d8f78952b1025907bba9e (patch) | |
tree | 4de40a616705d9a3994d6af4e0d88e6260e33664 /sbin | |
parent | d50ebd355c62e98b100d823a37ca58eb8a7a93c6 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sbin/restore/restore.c | 8 |
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 { |