git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
ZKZenobiusz Kunegunda <zenobiusz.kunegunda@interia.pl>
Date
Mar 22, 2017, 08:30 UTC
Message-ID
<nmvyuyfhjvyycfsdyczr@tyca>
In-Reply-To
<3e8b756c-81bd-0a29-e032-d5733a8b3ed0@web.de>
After applying mentioned patch to git v2.12.0 I was not able to reproduce bug.Od: "René Scharfe" &lt;l.s.r@web.de>
Do: "Zenobiusz Kunegunda" &lt;zenobiusz.kunegunda@interia.pl>; 
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 |
Show 44 quoted lines
> 
>> 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 &amp;&amp; cd /tmp/a/b
> 
> 	$ chmod $mode /tmp/a &amp;&amp; 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 &amp;&amp; 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é
> 
> 
Previous: René ScharfeNext: Zenobiusz Kunegunda
Message 21 of 23 in “fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |”
  1. Zenobiusz KunegundaMar 6, 2017
  2. René ScharfeMar 8, 2017
  3. Zenobiusz KunegundaMar 9, 2017
  4. René ScharfeMar 11, 2017
  5. Zenobiusz KunegundaMar 13, 2017
  6. René ScharfeMar 13, 2017
  7. Zenobiusz KunegundaMar 14, 2017
  8. Zenobiusz KunegundaMar 13, 2017
  9. René ScharfeMar 13, 2017
  10. Zenobiusz KunegundaMar 14, 2017
  11. René ScharfeMar 14, 2017
  12. Zenobiusz KunegundaMar 15, 2017
  13. René ScharfeMar 15, 2017
  14. René ScharfeMar 17, 2017
  15. Stefan BellerMar 17, 2017
  16. René ScharfeMar 17, 2017
  17. Jeff KingMar 17, 2017
  18. René ScharfeMar 17, 2017
  19. Zenobiusz KunegundaMar 21, 2017
  20. René ScharfeMar 21, 2017
  21. Zenobiusz KunegundaMar 22, 2017
  22. Zenobiusz KunegundaMar 21, 2017
  23. Zenobiusz KunegundaMar 9, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.