Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-04-28 20:01:54 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-04-28 20:01:54 +0400
commit43657e6bd3d292a6efb6b4a218101d430bfed03d (patch)
tree348502d79721f6fbf0b2d53c198c4d1c43950d50
parent08c76b4b9c7029b5d8eac8763304417de97f5a25 (diff)
* path.cc (symlink_info::check): Avoid special handling for
STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile. * strace.cc (strace::vprntf): Use bigger buffer.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/path.cc20
-rw-r--r--winsup/cygwin/strace.cc2
3 files changed, 14 insertions, 14 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 27e646fc8..0dfb396af 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
+ * path.cc (symlink_info::check): Avoid special handling for
+ STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile.
+ * strace.cc (strace::vprntf): Use bigger buffer.
+
+2008-04-28 Corinna Vinschen <corinna@vinschen.de>
+
* kernel32.cc (CreateFileMappingW): Remove stray small_printf.
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 2970c16b8..ef4ebec51 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2310,7 +2310,10 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
UNICODE_STRING dirname, basename;
OBJECT_ATTRIBUTES dattr;
HANDLE dir;
- FILE_DIRECTORY_INFORMATION fdi;
+ struct {
+ FILE_DIRECTORY_INFORMATION fdi;
+ WCHAR dummy_buf[NAME_MAX + 1];
+ } fdi_buf;
RtlSplitUnicodePath (&upath, &dirname, &basename);
InitializeObjectAttributes (&dattr, &dirname,
@@ -2328,27 +2331,18 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
else
{
status = NtQueryDirectoryFile (dir, NULL, NULL, 0, &io,
- &fdi, sizeof fdi,
+ &fdi_buf, sizeof fdi_buf,
FileDirectoryInformation,
TRUE, &basename, TRUE);
NtClose (dir);
- /* Per MSDN, ZwQueryDirectoryFile allows to specify a buffer
- which only fits the static parts of the structure (without
- filename that is) in the first call. The buffer actually
- contains valid data, even though ZwQueryDirectoryFile
- returned STATUS_BUFFER_OVERFLOW.
-
- Please note that this doesn't work for the info class
- FileIdBothDirectoryInformation, unfortunately, so we don't
- use this technique in fhandler_base::fstat_by_name, */
- if (!NT_SUCCESS (status) && status != STATUS_BUFFER_OVERFLOW)
+ if (!NT_SUCCESS (status))
{
debug_printf ("%p = NtQueryDirectoryFile(%S)",
status, &dirname);
fileattr = 0;
}
else
- fileattr = fdi.FileAttributes;
+ fileattr = fdi_buf.fdi.FileAttributes;
}
ext_tacked_on = !!*ext_here;
goto file_not_symlink;
diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc
index cba7e9a54..46726150a 100644
--- a/winsup/cygwin/strace.cc
+++ b/winsup/cygwin/strace.cc
@@ -234,7 +234,7 @@ strace::vprntf (unsigned category, const char *func, const char *fmt, va_list ap
{
DWORD err = GetLastError ();
int len;
- char buf[10000];
+ char buf[NT_MAX_PATH];
PROTECT (buf);
SetLastError (err);