From dad66a4f4f293b19db9c7939efff27a7bc8fc69a Mon Sep 17 00:00:00 2001 From: joe Date: Thu, 13 Jul 2000 22:13:42 +0000 Subject: 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. --- usr.sbin/mtree/mtree.8 | 3 +++ usr.sbin/mtree/mtree.c | 6 +++++- usr.sbin/mtree/verify.c | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'usr.sbin/mtree') 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) { -- cgit v1.1