summaryrefslogtreecommitdiff
path: root/sbin/restore
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-06-18 01:46:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-06-18 01:46:41 +0000
commit5e3757242ef3957773ecbe5d17f0bf1ccf88ab86 (patch)
tree3f2b9b0823a8018323d855316b7bf27137ce8502 /sbin/restore
parent80b0886105d88006c4f8d6a496a583fd93abd921 (diff)
Remove all links for an inode when "changing from leaf to node".
From Guy Harris <guy@netapp.com> via Kirk McKusick <mckusick@McKusick.COM>.
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/restore.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c
index b1822ca3b1f..e06d84ccdd6 100644
--- a/sbin/restore/restore.c
+++ b/sbin/restore/restore.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: restore.c,v 1.2 1996/06/23 14:32:17 deraadt Exp $ */
+/* $OpenBSD: restore.c,v 1.3 1997/06/18 01:46:40 millert Exp $ */
/* $NetBSD: restore.c,v 1.6 1995/03/18 14:59:51 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)restore.c 8.3 (Berkeley) 9/13/94";
#else
-static char rcsid[] = "$OpenBSD: restore.c,v 1.2 1996/06/23 14:32:17 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: restore.c,v 1.3 1997/06/18 01:46:40 millert Exp $";
#endif
#endif /* not lint */
@@ -435,8 +435,12 @@ nodeupdates(name, ino, type)
}
if (ip->e_type == LEAF) {
/* changing from leaf to node */
- removeleaf(ip);
- freeentry(ip);
+ for ( ; 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 {