summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2015-12-02 11:09:52 -0500
committerAndreas Gruenbacher <agruenba@redhat.com>2015-12-05 23:16:38 +0100
commitb6ba5c29a2ad9dcaac4191e81d2b497d396fa7d1 (patch)
tree3a2210ff76c4fbeaf47a7c2e774ea8f356c8942f /test
parentf2feb94748bd3c64ed153461afa51aebbd717821 (diff)
downloadacl-b6ba5c29a2ad9dcaac4191e81d2b497d396fa7d1.tar.gz
quote: escape literal backslashes
The octal unquote code can't handle escaping backslashes except by specifying the octal code for the backslash. That's not exactly a user-friendly interface for a scenario that may not be that uncommon. The unquote code isn't documented in the man page and can result in confusion when specifying names via a Windows domain that are entirely numeric (e.g. WINDOM\1234). This patch adds handling to allow literal escaping of the backslash (\\) as both input and output and documents the quoting rules in the setfacl man page. Also included are test cases for escaped backslashes followed by letters, escaped backslashes followed by numbers, and the original use case of escaped character literals. [Minor fixes by Andreas Gruenbacher.]
Diffstat (limited to 'test')
-rw-r--r--test/misc.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/misc.test b/test/misc.test
index 29372b7..c4d9774 100644
--- a/test/misc.test
+++ b/test/misc.test
@@ -454,6 +454,45 @@ Dangling symlink test http://savannah.nongnu.org/bugs/?28131
> setfacl: d/b: No such file or directory
$ rm -R d
+Handle escaped literal backslash followed by numeric username
+ $ mkdir d
+ $ touch d/f
+ $ setfacl -m u:domain\\\\12345:rw- d/f
+ $ getfacl --omit-header d/f
+ > user::rw-
+ > user:domain\\12345:rw-
+ > group::rw-
+ > mask::rw-
+ > other::r--
+ >
+ $ rm -R d
+
+Handle escaped literal backslash
+ $ mkdir d
+ $ touch d/f
+ $ setfacl -m u:domain\\\\user:rw- d/f
+ $ getfacl --omit-header d/f
+ > user::rw-
+ > user:domain\\user:rw-
+ > group::rw-
+ > mask::rw-
+ > other::r--
+ >
+ $ rm -R d
+
+Handle escaped literal characters by octal code (bin)
+ $ mkdir d
+ $ touch d/f
+ $ setfacl -m u:\\142\\151\\156:rw- d/f
+ $ getfacl --omit-header d/f
+ > user::rw-
+ > user:bin:rw-
+ > group::rw-
+ > mask::rw-
+ > other::r--
+ >
+ $ rm -R d
+
Malformed restore file
$ echo "# owner: root" > f