Re: [msysGit] [PATCH 1/2] symlinks: remove PATH_MAX limitation

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

 



Hi,

On Sat, 5 Jul 2014, Karsten Blees wrote:

> 'git checkout' fails if a directory is longer than PATH_MAX, because the
> lstat_cache in symlinks.c checks if the leading directory exists using
> PATH_MAX-bounded string operations.
> 
> Remove the limitation by using strbuf instead.
> 
> Signed-off-by: Karsten Blees <blees@xxxxxxx>
> ---
> 
> This fixes a bug on Windows with long paths [1].
> 
> [1] https://github.com/msysgit/msysgit/issues/227

For context: on Windows, PATH_MAX is ridiculously small. And it really is
that small, file functions of the Win32 API cannot handle longer paths.

However, there is a (pretty ugly, if you ask me) workaround: prefixing the
paths with "\\?\" and lo and behold, *many* (but not all) Win32 API
functions can then handle paths up to something around 32,000 characters!

The problem Karsten addressed here is caused exactly by this oddity: we
*can* handle paths much longer than PATH_MAX. Therefore, we need to
decouple the path buffers from that hardcoded limitation.

Karsten, you rock.

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]