summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>2001-04-19 01:39:27 +0000
committerjkh <jkh@FreeBSD.org>2001-04-19 01:39:27 +0000
commitc0ad0e9671b11b347795377aaccff91e49e3e58f (patch)
treed2d2d0a7cd8e12b76988ebb7271373dec9219f83 /sbin/dump
parent542c08e70c6c417e74bc5ccd731c667196f474d5 (diff)
downloadFreeBSD-src-c0ad0e9671b11b347795377aaccff91e49e3e58f.zip
FreeBSD-src-c0ad0e9671b11b347795377aaccff91e49e3e58f.tar.gz
Fix bogon with the nodump flag.
Submitted by: Dima Dorfman <dima@unixfreak.org>
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/traverse.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 72c4075..5d01130 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -155,13 +155,15 @@ mapfiles(maxino, tapesize)
if ((mode = (dp->di_mode & IFMT)) == 0)
continue;
/*
- * All dirs go in dumpdirmap; only inodes that are to
- * be dumped go in usedinomap and dumpinomap, however.
+ * Everything must go in usedinomap so that a check
+ * for "in dumpdirmap but not in usedinomap" to detect
+ * dirs with nodump set has a chance of succeeding
+ * (this is used in mapdirs()).
*/
+ SETINO(ino, usedinomap);
if (mode == IFDIR)
SETINO(ino, dumpdirmap);
if (WANTTODUMP(dp)) {
- SETINO(ino, usedinomap);
SETINO(ino, dumpinomap);
if (mode != IFREG && mode != IFDIR && mode != IFLNK)
*tapesize += 1;
@@ -169,8 +171,11 @@ mapfiles(maxino, tapesize)
*tapesize += blockest(dp);
continue;
}
- if (mode == IFDIR)
+ if (mode == IFDIR) {
+ if (!nonodump && (dp->di_flags & UF_NODUMP))
+ CLRINO(ino, usedinomap);
anydirskipped = 1;
+ }
}
/*
* Restore gets very upset if the root is not dumped,
@@ -218,7 +223,7 @@ mapdirs(maxino, tapesize)
* it isn't in usedinomap, we have to go through it to
* propagate the nodump flag.
*/
- nodump = (TSTINO(ino, usedinomap) == 0);
+ nodump = !nonodump && (TSTINO(ino, usedinomap) == 0);
if ((isdir & 1) == 0 || (TSTINO(ino, dumpinomap) && !nodump))
continue;
dp = getino(ino);
OpenPOWER on IntegriCloud