Changeset View
Changeset View
Standalone View
Standalone View
sbin/restore/dirs.c
Show First 20 Lines • Show All 640 Lines • ▼ Show 20 Lines | for (;;) { | ||||
} | } | ||||
if (ep == NULL) { | if (ep == NULL) { | ||||
panic("cannot find directory inode %ju\n", | panic("cannot find directory inode %ju\n", | ||||
(uintmax_t)node.ino); | (uintmax_t)node.ino); | ||||
continue; | continue; | ||||
} | } | ||||
cp = myname(ep); | cp = myname(ep); | ||||
if (!Nflag) { | if (!Nflag) { | ||||
if (myuid != 0) | |||||
(void) chown(cp, myuid, node.gid); | |||||
else | |||||
(void) chown(cp, node.uid, node.gid); | |||||
(void) chmod(cp, node.mode); | |||||
if (node.extsize > 0) { | if (node.extsize > 0) { | ||||
if (bufsize >= node.extsize) { | if (bufsize >= node.extsize) { | ||||
set_extattr(-1, cp, buf, node.extsize, SXA_FILE); | set_extattr(-1, cp, buf, node.extsize, SXA_FILE); | ||||
} else { | } else { | ||||
fprintf(stderr, "Cannot restore %s%s\n", | fprintf(stderr, "Cannot restore %s%s\n", | ||||
"extended attributes for ", cp); | "extended attributes for ", cp); | ||||
} | } | ||||
} | } | ||||
if (myuid != 0) | |||||
(void) chown(cp, myuid, node.gid); | |||||
else | |||||
(void) chown(cp, node.uid, node.gid); | |||||
(void) chmod(cp, node.mode); | |||||
utimensat(AT_FDCWD, cp, node.ctimep, 0); | utimensat(AT_FDCWD, cp, node.ctimep, 0); | ||||
utimensat(AT_FDCWD, cp, node.mtimep, 0); | utimensat(AT_FDCWD, cp, node.mtimep, 0); | ||||
(void) chflags(cp, node.flags); | (void) chflags(cp, node.flags); | ||||
} | } | ||||
ep->e_flags &= ~NEW; | ep->e_flags &= ~NEW; | ||||
} | } | ||||
if (bufsize > 0) | if (bufsize > 0) | ||||
free(buf); | free(buf); | ||||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |