summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mtree/compare.c
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>1999-12-09 20:38:36 +0000
committerjoe <joe@FreeBSD.org>1999-12-09 20:38:36 +0000
commit2d2f34a6b0d504ee514ce90ee4680797ca32254c (patch)
tree67ed32cdc7f451c6623d8ec3550f32874bffbf70 /usr.sbin/mtree/compare.c
parentc6d289b2ad57b3e51ea70ee85c86808035d1e10f (diff)
downloadFreeBSD-src-2d2f34a6b0d504ee514ce90ee4680797ca32254c.zip
FreeBSD-src-2d2f34a6b0d504ee514ce90ee4680797ca32254c.tar.gz
Added support for file flags, mostly merged from the NetBSD version.
The way is now open to schg and sappnd key files and directories in our tree. There are recommendations in bin/15229. PR: bin/15229 Reviewed by: imp, brian
Diffstat (limited to 'usr.sbin/mtree/compare.c')
-rw-r--r--usr.sbin/mtree/compare.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/usr.sbin/mtree/compare.c b/usr.sbin/mtree/compare.c
index d48db41..9f2db9f 100644
--- a/usr.sbin/mtree/compare.c
+++ b/usr.sbin/mtree/compare.c
@@ -216,6 +216,28 @@ typeerr: LABEL;
tab = "\t";
}
}
+ /*
+ * XXX
+ * since chflags(2) will reset file times, the utimes() above
+ * may have been useless! oh well, we'd rather have correct
+ * flags, rather than times?
+ */
+ if ((s->flags & F_FLAGS) && s->st_flags != p->fts_statp->st_flags) {
+ LABEL;
+ (void)printf("%sflags (\"%s\" is not ", tab,
+ flags_to_string(s->st_flags, "none"));
+ (void)printf("\"%s\"",
+ flags_to_string(p->fts_statp->st_flags, "none"));
+ if (uflag)
+ if (chflags(p->fts_accpath, s->st_flags))
+ (void)printf(", not modified: %s)\n",
+ strerror(errno));
+ else
+ (void)printf(", modified)\n");
+ else
+ (void)printf(")\n");
+ tab = "\t";
+ }
#ifdef MD5
if (s->flags & F_MD5) {
char *new_digest, buf[33];
OpenPOWER on IntegriCloud