* 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.
This commit is contained in:
Corinna Vinschen
2007-10-10 16:54:09 +00:00
parent 4797f5bca3
commit 044b62c767
3 changed files with 304 additions and 233 deletions

View File

@ -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 */