Subject: b18: bug in test -w/config.status is not writable
From: [email-masked] (Michael Van Biesbrouck)

6 Sep 1997 11:07:26 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Original-To: [email-masked]
X-Mailer: ELM [version 2.4 PL25]
Original-Sender: [email-masked]

I am not on the mailing list and after this afternoon will not have
access to an NT (or Win95) machine.  However, I recently fixed some bugs
in the b18 distributions.

One of the things that slowed down the configure scripts on my NT machine
was the failure to save config.status files.  Both the test program and
bash's builtin test incorrectly for writability.  (I create files under
a different userid than I really am but the eaccess implementations take
simplistic euid/egid+mode views of the world.)  The solution I used was
to make test actually call access ... eaccess attempts to solve a problem
that doesn't exist under NT.

diff -u -r o/user-tools/bash/test.c user-tools/bash/test.c
--- o/user-tools/bash/test.c	Thu Aug 28 19:08:40 1997
+++ user-tools/bash/test.c	Tue Apr 15 03:51:20 1997
@@ -122,11 +122,10 @@
 	do { test_error_return = val; longjmp (test_exit_buf, 1); } while (0)
 #endif /* STANDALONE */
 
-#if defined (AFS) || defined(__CYGWIN32__)
+#if defined (AFS)
   /* We have to use access(2) for machines running AFS, because it's
      not a Unix file system.  This may produce incorrect answers for
      non-AFS files.  I hate AFS. */
-  /* Cygwin32 has to deal with NT screwiness ... and succeeds in this case */
 #  define EACCESS(path, mode)	access(path, mode)
 #else
 #  define EACCESS(path, mode)	eaccess(path, mode)
diff -u -r o/user-tools/shellutils/src/test.c user-tools/shellutils/src/test.c
--- o/user-tools/shellutils/src/test.c	Thu Aug 28 19:09:08 1997
+++ user-tools/shellutils/src/test.c	Tue Apr 15 04:07:52 1997
@@ -167,10 +167,6 @@
   struct stat st;
   static int euid = -1;
 
-#ifdef __CYGWIN32__
-  return access(path, mode);	/* eaccess gets the wrong answers */
-#endif
-
   if (test_stat (path, &st) < 0)
     return (-1);

-- 
# -- Michael Van Biesbrouck,      [email-masked]
:b^Js/\(.*\)\(,.*\):\1\(.\)\([a-z]*\)\(.\)r\(:.*\)>\3/\4\2:\1\3\4\5r\6\5>/
s/\(.*\)\(,.*\):\1\(.\)\([a-z]*\)\(.\)l\(:.*\)\(.\)>\3/\4\2:\1\3\4\5l\6>\7\5/
s/>$/>0/^J/^halt/!bb^J#           http://www.csclub.uwaterloo.ca/u/mlvanbie/
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".