diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-04-04 13:38:42 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-04-04 13:38:42 +0000 |
commit | 54b7688e0dd6fed9685227c0c3656904b3e741ef (patch) | |
tree | 471977877bc492043cd99d5d8860014d2e41ae44 | |
parent | aebedcd52652974b02f4055a548b9e8f491ba33d (diff) | |
download | newlib-54b7688e0dd6fed9685227c0c3656904b3e741ef.zip newlib-54b7688e0dd6fed9685227c0c3656904b3e741ef.tar.gz newlib-54b7688e0dd6fed9685227c0c3656904b3e741ef.tar.bz2 |
* ntea (EA_BUFSIZ): Reduce to 64K. Add comment to explain why.
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/ntea.cc | 18 |
2 files changed, 18 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index faf5c36..81d216b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2014-04-04 Corinna Vinschen <corinna@vinschen.de> + + * ntea (EA_BUFSIZ): Reduce to 64K. Add comment to explain why. + 2014-03-29 Christopher Faylor <me.cygwin2014@cgf.cx> * DevNotes: Add entry cgf-000025. diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc index 3c86009..34d70d0 100644 --- a/winsup/cygwin/ntea.cc +++ b/winsup/cygwin/ntea.cc @@ -1,7 +1,7 @@ /* ntea.cc: code for manipulating Extended Attributes Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, - 2010, 2011 Red Hat, Inc. + 2010, 2011, 2014 Red Hat, Inc. This file is part of Cygwin. @@ -23,9 +23,19 @@ details. */ #define MAX_EA_NAME_LEN 256 #define MAX_EA_VALUE_LEN 65536 -/* At least one maximum sized entry fits. */ -#define EA_BUFSIZ (sizeof (FILE_FULL_EA_INFORMATION) + MAX_EA_NAME_LEN \ - + MAX_EA_VALUE_LEN) +/* At least one maximum sized entry fits. + CV 2014-04-04: I'm really puzzled how it should be possible to have 64K EAs, + if the NtQueryEaFile function chokes on buffers bigger than + 64K with STATUS_INVALID_PARAMETER, at least on Windows 7 and + later. In theory, the buffer size should be + + (sizeof (FILE_FULL_EA_INFORMATION) + MAX_EA_NAME_LEN + + MAX_EA_VALUE_LEN + + to read a single 64K EA. But maybe I just misunderstood and + EAs can't be 64K. I can't find the source I got this + information from anymore. */ +#define EA_BUFSIZ MAX_EA_VALUE_LEN #define NEXT_FEA(p) ((PFILE_FULL_EA_INFORMATION) (p->NextEntryOffset \ ? (char *) p + p->NextEntryOffset : NULL)) |