summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-02-25 14:27:43 +0000
committerLars Wirzenius <liw@liw.fi>2012-02-25 14:27:43 +0000
commit907faf600f4d95eaae4b5c2fc0e8bc06c3efe48e (patch)
tree79ca1d60da3f85738f4a1cbc890811c99628dbdd /tests
parenta4a011dd30194eb3f1af728a887199d99da7ec29 (diff)
downloadsummain-907faf600f4d95eaae4b5c2fc0e8bc06c3efe48e.tar.gz
Do not recurse through a symlink given as root
Diffstat (limited to 'tests')
-rwxr-xr-xtests/symlink.script10
-rw-r--r--tests/symlink.stdout7
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/symlink.script b/tests/symlink.script
new file mode 100755
index 0000000..d5dd25e
--- /dev/null
+++ b/tests/symlink.script
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+mkdir "$DATADIR/dir"
+touch "$DATADIR/dir/file"
+ln -s dir "$DATADIR/symlink"
+./summain --exclude=mtime --exclude=uid --exclude=username \
+ --exclude=gid --exclude=group --exclude=mode "$DATADIR/symlink" |
+sed 's,^Name: /.*/,Name: ,'
diff --git a/tests/symlink.stdout b/tests/symlink.stdout
new file mode 100644
index 0000000..8288ba8
--- /dev/null
+++ b/tests/symlink.stdout
@@ -0,0 +1,7 @@
+Name: symlink
+Ino: 1
+Dev: 1
+Nlink: 1
+Size: 3
+Target: dir
+