summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-07-13 22:13:42 +0000
committerjoe <joe@FreeBSD.org>2000-07-13 22:13:42 +0000
commitdad66a4f4f293b19db9c7939efff27a7bc8fc69a (patch)
treedd0ba243240866bc964b8cd557a8aad95f798589
parent1a2da9c569393657e716341d0de1a0a7194a3cb0 (diff)
downloadFreeBSD-src-dad66a4f4f293b19db9c7939efff27a7bc8fc69a.zip
FreeBSD-src-dad66a4f4f293b19db9c7939efff27a7bc8fc69a.tar.gz
Added a flag (-S) to mtree to specify that symlinks shouldn't be
followed. This allows type=link matches to work properly and match the link itself, instead of the file/directory that the link is pointing to.
-rw-r--r--usr.sbin/mtree/mtree.83
-rw-r--r--usr.sbin/mtree/mtree.c6
-rw-r--r--usr.sbin/mtree/verify.c1
3 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/mtree/mtree.8 b/usr.sbin/mtree/mtree.8
index 4a08930..6f4d16d 100644
--- a/usr.sbin/mtree/mtree.8
+++ b/usr.sbin/mtree/mtree.8
@@ -98,6 +98,9 @@ instead of the current directory.
.It Fl r
Remove any files in the file hierarchy that are not described in the
specification.
+.It Fl S
+Don't follow symbolic links in the file hierarchy, instead consider
+the symbolic link itself in any comparisons.
.It Fl s Ar seed
Display a single checksum to the standard error output that represents all
of the files for which the keyword
diff --git a/usr.sbin/mtree/mtree.c b/usr.sbin/mtree/mtree.c
index ee4eb50..734701b 100644
--- a/usr.sbin/mtree/mtree.c
+++ b/usr.sbin/mtree/mtree.c
@@ -77,7 +77,7 @@ main(argc, argv)
keys = KEYDEFAULT;
init_excludes();
- while ((ch = getopt(argc, argv, "cdef:iK:k:np:rs:UuxX:")) != -1)
+ while ((ch = getopt(argc, argv, "cdef:iK:k:np:rs:SUuxX:")) != -1)
switch((char)ch) {
case 'c':
cflag = 1;
@@ -120,6 +120,10 @@ main(argc, argv)
crc_total = ~strtol(optarg, &p, 0);
if (*p)
errx(1, "illegal seed value -- %s", optarg);
+ case 'S':
+ ftsoptions ^= FTS_LOGICAL;
+ ftsoptions |= FTS_PHYSICAL;
+ break;
case 'U':
Uflag = 1;
uflag = 1;
diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c
index f182996..25b33aa 100644
--- a/usr.sbin/mtree/verify.c
+++ b/usr.sbin/mtree/verify.c
@@ -96,6 +96,7 @@ vwalk()
}
switch(p->fts_info) {
case FTS_D:
+ case FTS_SL:
break;
case FTS_DP:
if (specdepth > p->fts_level) {
OpenPOWER on IntegriCloud