From 044b62c7676d56bcabea5956cae38771eb5b2179 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 10 Oct 2007 16:54:09 +0000 Subject: * path.cc (struct symlink_info): Change size of contents member to be able to keep SYMLINK_MAX sized strings. (symlink_worker): Rework for long path names. When writing windows shortcuts, store pathname additionally "hidden" after the actual shortcut data to workaround size limitations of the description field. (symlink_info::check_shortcut): Drop file name parameter. Drop max file size check. Use NT functions. Use appended full path if available, description otherwise. Check symlink string length for not exceeding SYMLINK_MAX. Don't close file here. (symlink_info::check_sysfile): Drop file name parameter. Use NT functions. Check symlink string length for not exceeding SYMLINK_MAX. Don't close file here. (symlink_info::check_reparse_point): Drop file name parameter. Drop useless length checks. Allow SYMLINK_MAX length symlink strings. Don't close file here. (symlink_info::posixify): Allow SYMLINK_MAX length symlink strings. (symlink_info::check): Turn around checking for symlink file attributes. Use NT functions. Close symlink file here. * include/limits.h (PATH_MAX): Define as 32760. Change comment. (SYMLINK_MAX): Define as PATH_MAX - 1. --- winsup/cygwin/include/limits.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/include') diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h index f7ae460e8..6dcf9caa1 100644 --- a/winsup/cygwin/include/limits.h +++ b/winsup/cygwin/include/limits.h @@ -318,9 +318,10 @@ details. */ #undef NAME_MAX #define NAME_MAX 255 -/* Maximum length of a path */ +/* Maximum length of a path including trailing NUL. + (32767 - max. native NT path prefix) */ #undef PATH_MAX -#define PATH_MAX 260 +#define PATH_MAX 32760 /* # of bytes in a pipe buf. This is the max # of bytes which can be written to a pipe in one atomic operation. */ @@ -352,7 +353,7 @@ details. */ /* Maximum number of bytes in a symbolic link. */ #undef SYMLINK_MAX -#define SYMLINK_MAX PATH_MAX +#define SYMLINK_MAX (PATH_MAX - 1) /* Runtime Increasable Values */ -- cgit v1.2.3