[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Be nice with file systems that don't handle unusual characte
Re: [PATCH] Be nice with file systems that don't handle unusual characters.
Tue, 4 Mar 2008 22:06:55 +0000 (UTC)
Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:
> 2008-03-01 Benoit Sigoure <tsuna <at> lrde.epita.fr>
> + Be nice with file systems that don't handle unusual characters.
> + * tests/atlocal.in (func_sanitize_file_name)
> +# Check whether the underlying system can manage some unusual
> +# symbols in file names.
> +for c in '\\' '"' '<' '>' '*' '?' '|'
> + touch "t$c" 2>/dev/null
> + test -f "t$c" && rm -f "t$c" && continue
> + # $c cannot be used in a file name.
It turns out that this patch exposed a cygwin bug - open("t\\", O_RDONLY |
O_CREAT) was creating the regular file 't' rather than failing with ENOENT
since the directory 't\' does not exist (remembering that \ is an alternate
directory separator, rather than a regular file name character). So I'm
checking in this, while waiting for the cygwin maintainers to fix the bug:
From: Eric Blake <address@hidden>
Date: Tue, 4 Mar 2008 14:28:54 -0700
Subject: [PATCH] Ignore tests that require read-only directories under root.
* tests/torture.at (AT_CHECK_CONFIG_CREATION_NOWRITE): Skip
no-write portion if user has root-like privileges.
Signed-off-by: Eric Blake <address@hidden>
ChangeLog | 6 ++++++
tests/torture.at | 10 +++++++++-
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 08cfd73..0b699fa 100644
@@ -1,3 +1,9 @@
+2008-03-04 Eric Blake <address@hidden>
+ Ignore tests that require read-only directories under root.
+ * tests/torture.at (AT_CHECK_CONFIG_CREATION_NOWRITE): Skip
+ no-write portion if user has root-like privileges.
2008-03-03 Eric Blake <address@hidden>
diff --git a/tests/torture.at b/tests/torture.at
index 58785ae..d8ae8f3 100644
@@ -211,9 +211,17 @@ AT_CHECK([grep OK $1], , [OK
# config.status might be stupidly expecting data on stdin, if it's
# really broken...
+# Skip check if user can rename files into a read-only directory (when
+# run by root or on w32).
chmod a-w .
-AT_CHECK([./config.status var-$1 </dev/null], , [ignore], [ignore])
+if mv t t1 >/dev/null 2>&1 ; then
+ AT_CHECK([./config.status var-$1 </dev/null], , [ignore], [ignore])
chmod u+w .
+rm -rf t t1