Hi,
Could you please test attached patch? (put it under debian/diff/)
dash should now return the same results as bash and /usr/bin/test.
Actually analysing the situation I started to wonder why the current method
doesn't work. Could you please provide the output of stat /?
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
diff -urpN dash-0.5.5.1-2.3.orig/configure dash-0.5.5.1-2.3/configure
--- dash-0.5.5.1-2.3.orig/configure 2009-01-13 17:37:33.000000000 -0600
+++ dash-0.5.5.1-2.3/configure 2009-08-26 16:21:33.284377066 -0500
@@ -4231,9 +4231,9 @@ done
-for ac_func in bsearch getpwnam getrlimit imaxdiv isalpha killpg mempcpy \
- sigsetmask stpcpy strchrnul strsignal strtod strtoimax \
- strtoumax sysconf
+for ac_func in bsearch eaccess getpwnam getrlimit imaxdiv isalpha killpg \
+ mempcpy sigsetmask stpcpy strchrnul strsignal strtod \
+ strtoimax strtoumax sysconf
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
diff -urpN dash-0.5.5.1-2.3.orig/configure.ac dash-0.5.5.1-2.3/configure.ac
--- dash-0.5.5.1-2.3.orig/configure.ac 2009-01-13 17:37:13.000000000 -0600
+++ dash-0.5.5.1-2.3/configure.ac 2009-08-26 16:21:33.284377066 -0500
@@ -46,9 +46,9 @@ dnl Checks for header files.
AC_CHECK_HEADERS(alloca.h)
dnl Checks for library functions.
-AC_CHECK_FUNCS(bsearch getpwnam getrlimit imaxdiv isalpha killpg mempcpy \
- sigsetmask stpcpy strchrnul strsignal strtod strtoimax \
- strtoumax sysconf)
+AC_CHECK_FUNCS(bsearch eaccess getpwnam getrlimit imaxdiv isalpha killpg \
+ mempcpy sigsetmask stpcpy strchrnul strsignal strtod \
+ strtoimax strtoumax sysconf)
if test "$enable_fnmatch" = yes; then
use_fnmatch=
diff -urpN dash-0.5.5.1-2.3.orig/src/bltin/test.c dash-0.5.5.1-2.3/src/bltin/test.c
--- dash-0.5.5.1-2.3.orig/src/bltin/test.c 2009-01-13 17:37:13.000000000 -0600
+++ dash-0.5.5.1-2.3/src/bltin/test.c 2009-08-26 16:22:51.396377891 -0500
@@ -364,12 +364,21 @@ filstat(char *nm, enum token mode)
return 0;
switch (mode) {
+#ifdef HAVE_EACCESS
+ case FILRD:
+ return eaccess(nm, R_OK) == 0;
+ case FILWR:
+ return eaccess(nm, W_OK) == 0;
+ case FILEX:
+ return (test_st_mode(&s, X_OK) && eaccess(nm, X_OK) == 0);
+#else
case FILRD:
return test_st_mode(&s, R_OK);
case FILWR:
return test_st_mode(&s, W_OK);
case FILEX:
return test_st_mode(&s, X_OK);
+#endif
case FILEXIST:
return 1;
case FILREG: