# [RFC] test-lib.sh: No POSIXPERM for cygwin

6 messages from 2013-01-27 to 2013-02-08. Participants: Torsten Bögershausen, Erik Faye-Lund, Ramsay Jones, Junio C Hamano.
Thread: https://gitlist.dev/t/32744

## Torsten Bögershausen, 2013-01-27 14:57

Subject: [RFC] test-lib.sh: No POSIXPERM for cygwin
Message-ID: <201301271557.08994.tboegi@web.de>
URL: https://gitlist.dev/e/201301271557.08994.tboegi%40web.de

```
t0070 and t1301 fail when running the test suite under cygwin.
Skip the failing tests by unsetting POSIXPERM.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
 t/test-lib.sh | 1 -
 1 file changed, 1 deletion(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1a6c4ab..94b097e 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -669,7 +669,6 @@ case $(uname -s) in
 	test_set_prereq SED_STRIPS_CR
 	;;
 *CYGWIN*)
-	test_set_prereq POSIXPERM
 	test_set_prereq EXECKEEPSPID
 	test_set_prereq NOT_MINGW
 	test_set_prereq SED_STRIPS_CR
-- 
1.8.1.1

```

## Erik Faye-Lund, 2013-02-06 09:34

Subject: Re: [RFC] test-lib.sh: No POSIXPERM for cygwin
Message-ID: <CABPQNSYmGhaDG0Dzpp2C0ZwKoFwP5EokJW+TC8JT-Bw6rKa79A@mail.gmail.com>
URL: https://gitlist.dev/e/CABPQNSYmGhaDG0Dzpp2C0ZwKoFwP5EokJW%2BTC8JT-Bw6rKa79A%40mail.gmail.com
In-Reply-To: <201301271557.08994.tboegi@web.de>

```
On Sun, Jan 27, 2013 at 3:57 PM, Torsten Bögershausen <tboegi@web.de> wrote:
> t0070 and t1301 fail when running the test suite under cygwin.
> Skip the failing tests by unsetting POSIXPERM.
>

But is this the real reason? I thought Cygwin implemented POSIX permissions...?

```

## Torsten Bögershausen, 2013-02-06 20:16

Subject: Re: [RFC] test-lib.sh: No POSIXPERM for cygwin
Message-ID: <5112BA0D.6020200@web.de>
URL: https://gitlist.dev/e/5112BA0D.6020200%40web.de
In-Reply-To: <CABPQNSYmGhaDG0Dzpp2C0ZwKoFwP5EokJW+TC8JT-Bw6rKa79A@mail.gmail.com>

```
Am 2013-02-06 10:34, schrieb Erik Faye-Lund:
> On Sun, Jan 27, 2013 at 3:57 PM, Torsten Bögershausen <tboegi@web.de> wrote:
>> t0070 and t1301 fail when running the test suite under cygwin.
>> Skip the failing tests by unsetting POSIXPERM.
>>
>
> But is this the real reason? I thought Cygwin implemented POSIX permissions...?
t0070:
  'mktemp to unwritable directory prints filename'
   mkdir cannotwrite &&
   chmod -w cannotwrite &&
   test_when_finished "chmod +w cannotwrite" &&
   test_must_fail test-mktemp cannotwrite/testXXXXXX 2>err &&
   grep "cannotwrite/test" err

When a directory under Linux/*nix has no write permission,
it is not allowed to create another directory (or file..) here.
This is not working under cygwin, a directory/file can be created
even if the parent directory has chmod 0.
-------------
tb@PC /cygdrive/c/temp
$ mkdir ttt

tb@PC /cygdrive/c/temp
$ chmod 0 ttt

tb@PC /cygdrive/c/temp
$ ls -ld ttt
d---------+ 1 tb None 0 Feb  6 20:33 ttt

tb@PC /cygdrive/c/temp
$ touch ttt/x

tb@PC /cygdrive/c/temp
$ ls -ld ttt
d---------+ 1 tb None 0 Feb  6 20:33 ttt

tb@PC /cygdrive/c/temp
$ ls -l ttt
total 0
-rw-r--r--+ 1 tb None 0 Feb  6 20:33 x
-------------------------------------------

If this is POSIX compliant? I'm not an expert here.
On the other hand:
This test case does not test git, but rather the file system,
so we can probaly remove it?

About 1301:
Some resereach needs to be done, to find out the connection between
umask, cygwin and the mount options.

On my system I have:
$mount
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)

/Torsten

```

## Ramsay Jones, 2013-02-07 18:25

Subject: Re: [RFC] test-lib.sh: No POSIXPERM for cygwin
Message-ID: <5113F1B1.3010102@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/5113F1B1.3010102%40ramsay1.demon.co.uk
In-Reply-To: <201301271557.08994.tboegi@web.de>

```
Torsten Bögershausen wrote:
> t0070 and t1301 fail when running the test suite under cygwin.
> Skip the failing tests by unsetting POSIXPERM.

t1301 does not fail for me. (WIN XP (SP3) on NTFS)
[It's so long since I looked, but I'm pretty sure that the failure
in t0070 is caused by *git*, not by cygwin not supporting POSIXPERM]

> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
> ---
>  t/test-lib.sh | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 1a6c4ab..94b097e 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -669,7 +669,6 @@ case $(uname -s) in
>  	test_set_prereq SED_STRIPS_CR
>  	;;
>  *CYGWIN*)
> -	test_set_prereq POSIXPERM
>  	test_set_prereq EXECKEEPSPID
>  	test_set_prereq NOT_MINGW
>  	test_set_prereq SED_STRIPS_CR
> 

So, I'm not in favour of this, FWIW.

ATB,
Ramsay Jones

```

## Junio C Hamano, 2013-02-07 19:35

Subject: Re: [RFC] test-lib.sh: No POSIXPERM for cygwin
Message-ID: <7vd2wb7w96.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd2wb7w96.fsf%40alter.siamese.dyndns.org
In-Reply-To: <5113F1B1.3010102@ramsay1.demon.co.uk>

```
Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:

> Torsten Bögershausen wrote:
>> t0070 and t1301 fail when running the test suite under cygwin.
>> Skip the failing tests by unsetting POSIXPERM.
>
> t1301 does not fail for me. (WIN XP (SP3) on NTFS)

Others run Cygwin with vfat or some other filesystem, and some of
them do not cope will with POSIXPERM, perhaps?

Not having POSIXPERM by default for Cygwin may be a saner default
than having one, if we have to pick one.

It may be debatable to have this default as platform attribute,
though.

>> Signed-off-by: Torsten Bögershausen <tboegi@web.de>
>> ---
>>  t/test-lib.sh | 1 -
>>  1 file changed, 1 deletion(-)
>> 
>> diff --git a/t/test-lib.sh b/t/test-lib.sh
>> index 1a6c4ab..94b097e 100644
>> --- a/t/test-lib.sh
>> +++ b/t/test-lib.sh
>> @@ -669,7 +669,6 @@ case $(uname -s) in
>>  	test_set_prereq SED_STRIPS_CR
>>  	;;
>>  *CYGWIN*)
>> -	test_set_prereq POSIXPERM
>>  	test_set_prereq EXECKEEPSPID
>>  	test_set_prereq NOT_MINGW
>>  	test_set_prereq SED_STRIPS_CR
>> 
>
> So, I'm not in favour of this, FWIW.
>
> ATB,
> Ramsay Jones

```

## Torsten Bögershausen, 2013-02-08 06:08

Subject: Re: [RFC] test-lib.sh: No POSIXPERM for cygwin
Message-ID: <5114964E.9010609@web.de>
URL: https://gitlist.dev/e/5114964E.9010609%40web.de
In-Reply-To: <7vd2wb7w96.fsf@alter.siamese.dyndns.org>

```
On 07.02.13 20:35, Junio C Hamano wrote:
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:
>
>> Torsten Bögershausen wrote:
>>> t0070 and t1301 fail when running the test suite under cygwin.
>>> Skip the failing tests by unsetting POSIXPERM.
>> t1301 does not fail for me. (WIN XP (SP3) on NTFS)
> Others run Cygwin with vfat or some other filesystem, and some of
> them do not cope will with POSIXPERM, perhaps?
>
> Not having POSIXPERM by default for Cygwin may be a saner default
> than having one, if we have to pick one.
>
> It may be debatable to have this default as platform attribute,
> though.
>
Yes, 1301 passes on cygwin 1.5, but not on 1.7.
And it breaks on VFAT, for all kind of OS.

Thanks for comments, I'll put more investigations on my todo stack.
/Torsten

```
