From b9595aa55f0be298b06c8410571af556af437401 Mon Sep 17 00:00:00 2001
From: Dima Dorfman
Date: Mon, 20 Aug 2001 02:15:22 +0000
Subject: [PATCH] Respect the -N flag when changing directory attributes in
setdirmode).
PR: 29671
Submitted by: Sascha Blank
---
sbin/restore/dirs.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index c61737af08a0..e822f5d18062 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -636,10 +636,12 @@ setdirmodes(flags)
panic("cannot find directory inode %d\n", node.ino);
} else {
cp = myname(ep);
- (void) chown(cp, node.uid, node.gid);
- (void) chmod(cp, node.mode);
- utimes(cp, node.timep);
- (void) chflags(cp, node.flags);
+ if (!Nflag) {
+ (void) chown(cp, node.uid, node.gid);
+ (void) chmod(cp, node.mode);
+ utimes(cp, node.timep);
+ (void) chflags(cp, node.flags);
+ }
ep->e_flags &= ~NEW;
}
}