Re: rcs-5.8 test failure

Paul Eggert <[email protected]> Mon, 17 Oct 2011 16:15:36 -0700
Newsgroups gmane.comp.version-control.rcs.bugs
Organization UCLA Computer Science Department
Message-ID <[email protected]>
On 10/17/11 14:57, Karl Berry wrote:
> test -w /".
> 
> Couldn't it fail on NFS-mounted root filesystems?

Yes in theory, but in practice the NFS-mounted root
file systems that I've dealt with have been explicitly
root-writable, using no_root_squash in the server's
/etc/exports or equivalent.

> test -w / could certainly have a false positive

True.  (Though at least our tests will pass....)

Perhaps a better approach would be something like the
following: it avoids the issue for NFS-mounted roots
in exactly the same way that it avoids it for Cygwin.

--- common-i	2011-08-08 04:54:51.000000000 -0700
+++ common-i-fix	2011-10-17 16:12:04.686900722 -0700
@@ -29,10 +29,9 @@ log_rx=
 cmd=
 wdisp=
 
-case $(uname -s | tr A-Z a-z) in
-    cygwin*) dont_check_readonly=true ;;
-    *)       dont_check_readonly=false ;;
-esac
+dont_check_readonly=false
+(umask a-w && test -w $wd/toe >$wd/toe) && dont_check_readonly=true
+rm -f $wd/toe || problem "$wd/toe not removed"
 
 # functions