Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After applying mentioned patch to git v2.12.0 I was not able to reproduce bug.Od: "René Scharfe" <l.s.r@xxxxxx>
Do: "Zenobiusz Kunegunda" <zenobiusz.kunegunda@xxxxxxxxxx>; 
Wysłane: 20:06 Wtorek 2017-03-21
Temat: Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

> 
>> Am 21.03.2017 um 14:29 schrieb Zenobiusz Kunegunda:
>> I think I found a way to reproduce this error.
>> I installed FreeBSD 10.3 under qemu with zfs partitioning.
>> Test program did not report any access errors.
>> Then I did chmod 711 /usr/home
>> Now program started reporting permission denied errors just like this:
>>    $ ./a.out
>>    len = 0, errno = 22, Invalid argument
>>    len = 1, errno = 34, Result too large
>>    len = 2, errno = 13, Permission denied
>>    len = 20, errno = 0, No error: 0
> 
> Yes, and I think we can take ZFS out of the equation.  As a regular user 
> I get this with UFS and for $mode values of 000, 100 or 400 (with umask 
> 0022):
> 
> 	$ mkdir -p /tmp/a/b && cd /tmp/a/b
> 
> 	$ chmod $mode /tmp/a && getcwdtest
> 	len = 0, errno = 22, Invalid argument
> 	len = 1, errno = 34, Result too large
> 	len = 2, errno = 13, Permission denied
> 	len = 9, errno = 0, No error: 0
> 
> Only with both read and execute/search permissions for the intermediate 
> directory I get rid of that irritating permission error for small buffers:
> 
> 	$ chmod 500 /tmp/a && getcwdtest
> 	len = 0, errno = 22, Invalid argument
> 	len = 1, errno = 34, Result too large
> 	len = 9, errno = 0, No error: 0
> 
> So a workaround for you would be to run "chmod a+rx" (or similar) 
> against all parent directories of your repository.  Another one would be 
> to keep the path length below 128 characters (that's the initial buffer 
> size in strbuf_getcwd()).
> 
> Have you been able to test the patch I sent on Friday by any chance?
> 
> Thanks,
> René
> 
> 




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]