summaryrefslogtreecommitdiff
path: root/tests/chmod
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chmod')
-rwxr-xr-xtests/chmod/c-option.sh15
-rwxr-xr-xtests/chmod/equal-x.sh2
-rwxr-xr-xtests/chmod/equals.sh2
-rwxr-xr-xtests/chmod/inaccessible.sh2
-rwxr-xr-xtests/chmod/no-x.sh2
-rwxr-xr-xtests/chmod/octal.sh2
-rwxr-xr-xtests/chmod/setgid.sh2
-rwxr-xr-xtests/chmod/silent.sh2
-rwxr-xr-xtests/chmod/thru-dangling.sh2
-rwxr-xr-xtests/chmod/umask-x.sh2
-rwxr-xr-xtests/chmod/usage.sh2
11 files changed, 23 insertions, 12 deletions
diff --git a/tests/chmod/c-option.sh b/tests/chmod/c-option.sh
index 23fffeab..03e1db9a 100755
--- a/tests/chmod/c-option.sh
+++ b/tests/chmod/c-option.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Verify that chmod's --changes (-c) option works.
-# Copyright (C) 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 2000-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,10 +31,21 @@ chmod u=rwx $file || fail=1
chmod -c g=rwx $file > out || fail=1
chmod -c g=rwx $file > empty || fail=1
-test -s empty && fail=1
+compare /dev/null empty || fail=1
case "$(cat out)" in
"mode of 'f' changed from 0744 "?rwxr--r--?" to 0774 "?rwxrwxr--?) ;;
*) cat out; fail=1 ;;
esac
+# From V5.1.0 to 8.22 this would stat the wrong file and
+# give an erroneous ENOENT diagnostic
+mkdir -p a/b || framework_failure_
+# chmod g+s might fail as detailed in setgid.sh
+# but we don't care about those edge cases here
+chmod g+s a/b
+# This should never warn, but it did when special
+# bits are set on b (the common case under test)
+chmod -c -R g+w a 2>err
+compare /dev/null err || fail=1
+
Exit $fail
diff --git a/tests/chmod/equal-x.sh b/tests/chmod/equal-x.sh
index de7ff547..75a2fa1a 100755
--- a/tests/chmod/equal-x.sh
+++ b/tests/chmod/equal-x.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test "chmod =x" and the like.
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/equals.sh b/tests/chmod/equals.sh
index f0dc9e67..4daba4be 100755
--- a/tests/chmod/equals.sh
+++ b/tests/chmod/equals.sh
@@ -3,7 +3,7 @@
# Before fileutils-4.1.2, some of them didn't.
# Also, before coreutils-5.3.1, =[ugo] sometimes didn't work.
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/inaccessible.sh b/tests/chmod/inaccessible.sh
index 0863a6e3..2ef2a61f 100755
--- a/tests/chmod/inaccessible.sh
+++ b/tests/chmod/inaccessible.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test for the bug fixed on 2006-09-20.
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/no-x.sh b/tests/chmod/no-x.sh
index 76c8fa40..64e81ed8 100755
--- a/tests/chmod/no-x.sh
+++ b/tests/chmod/no-x.sh
@@ -2,7 +2,7 @@
# Make sure chmod gives the right diagnostic for a readable,
# but inaccessible directory.
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/octal.sh b/tests/chmod/octal.sh
index eaf39208..895c8348 100755
--- a/tests/chmod/octal.sh
+++ b/tests/chmod/octal.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# ensure that chmod diagnoses a certain type of invalid mode string
-# Copyright (C) 2005-2013 Free Software Foundation, Inc.
+# Copyright (C) 2005-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/setgid.sh b/tests/chmod/setgid.sh
index fac37e84..0c0722de 100755
--- a/tests/chmod/setgid.sh
+++ b/tests/chmod/setgid.sh
@@ -3,7 +3,7 @@
# on directories with the setgid bit set. Also, check that the GNU octal
# notations work.
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/silent.sh b/tests/chmod/silent.sh
index 30529ac1..5d5dcb58 100755
--- a/tests/chmod/silent.sh
+++ b/tests/chmod/silent.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# ensure that chgrp, chmod, chown -f don't print some diagnostics
-# Copyright (C) 2008-2013 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/thru-dangling.sh b/tests/chmod/thru-dangling.sh
index e6053d0f..4a137e81 100755
--- a/tests/chmod/thru-dangling.sh
+++ b/tests/chmod/thru-dangling.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test for proper error and exit code of chmod on a dangling symlink.
-# Copyright (C) 2007-2013 Free Software Foundation, Inc.
+# Copyright (C) 2007-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/umask-x.sh b/tests/chmod/umask-x.sh
index 33166e41..9e0e0012 100755
--- a/tests/chmod/umask-x.sh
+++ b/tests/chmod/umask-x.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Test that chmod -x file reports an error if the result is executable.
-# Copyright (C) 2005-2013 Free Software Foundation, Inc.
+# Copyright (C) 2005-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/tests/chmod/usage.sh b/tests/chmod/usage.sh
index 2187e35c..7e27e7ce 100755
--- a/tests/chmod/usage.sh
+++ b/tests/chmod/usage.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Verify that chmod works correctly with odd option combinations.
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by