PATCH] Fix for PR fortran/38956
David Billinghurst
dbcygwin@gmail.com
Fri Jan 30 22:12:00 GMT 2009
Jack Howarth wrote:
> On Fri, Jan 30, 2009 at 12:58:21PM +1100, David Billinghurst wrote:
>> PR PR38956 is the failure of testsuite/gfortran.dg/chmod_{1,2,3}.f90 on i686-pc-cygwin.
>>
>> The problem is due to a mismatch between Windows and POSIX file access models.
>> Under Windows, accounts with Administrator rights can write to any file
>> regardless of the file permission. There is no easy way to check for this
>> from Fortran.
>>
>> This patch removes the failing parts of tests chmod_{1,2,3}.f90 and
>> adds them to a new test chmod_4.f90
>>
>> Likewise for gfortran.dg/open_errors.f90.
>>
>> 2009-01-29 David Billinghurst (billingd@gcc.gnu.org)
>>
>> PR fortran/38956
>> * gfortran.dg/chmod_1.f90: Remove test that fails on cygwin
>> * gfortran.dg/chmod_2.f90: Likewise
>> * gfortran.dg/chmod_3.f90: Likewise
>> * gfortran.dg/open_errors.f90: Likewise
>> * gfortran.dg/chmod_4.f90: New test with failing tests above.
>> * gfortran.dg/open_errors_2.f90: Likewise
>>
>>
>> Index: chmod_1.f90
>> ===================================================================
>> --- chmod_1.f90 (revision 143773)
>> +++ chmod_1.f90 (working copy)
>> @@ -19,11 +19,6 @@
>> if (access(n,"x") /= 0 .or. access(n,"X") /= 0) call abort
>> end if
>>
>> - call chmod (n, "a-w", i)
>> - if (i == 0 .and. getuid() /= 0) then
>> - if (access(n,"w") == 0 .or. access(n,"W") == 0) call abort
>> - end if
>> -
>> open (10,file=n)
>> close (10,status="delete")
> I believe those checks are in place to allow the test cases in question to
> pass when run as sudo (when the gcc build tree is owned by root). If you
> remove those checks, the chmod_1.f90, chmod_2.f90, chmod_3.f90 and
> open_errors.f90 testcases will all begin to fail again when run as sudo.
> Not good.
> Jack
My understanding is that I have removed the parts of the test that fail
when run as root on a unix system, so there won't be a problem.
However, I have not tested this. I will.
More information about the Fortran
mailing list