From 64dcb076529b3178b2114caa2e3641dfdf3b3e81 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 2 May 2000 00:25:43 +0000 Subject: [PATCH] * dcrt0.cc: Add dynamic load code for `OemToCharA' from user32.dll. * security.cc (read_sd): Call `OemToCharA' to make `GetFileSecurity' happy on filenames with umlauts. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/dcrt0.cc | 1 + winsup/cygwin/security.cc | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ca3339961..531b04e39 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Tue May 2 2:22:00 2000 Corinna Vinschen + + * dcrt0.cc: Add dynamic load code for `OemToCharA' from user32.dll. + * security.cc (read_sd): Call `OemToCharA' to make + `GetFileSecurity' happy on filenames with umlauts. + Wed Apr 26 23:23:23 2000 Christopher Faylor * path.cc (normalize_win32_path): Don't add a trailing slash when one diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 76a5015f0..c0107bdac 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -1036,6 +1036,7 @@ LoadDLLfunc (GetUserObjectInformationA, GetUserObjectInformationA@20, user32) LoadDLLfunc (KillTimer, KillTimer@8, user32) LoadDLLfunc (MessageBoxA, MessageBoxA@16, user32) LoadDLLfunc (MsgWaitForMultipleObjects, MsgWaitForMultipleObjects@20, user32) +LoadDLLfunc (OemToCharA, OemToCharA@8, user32) LoadDLLfunc (OemToCharW, OemToCharW@8, user32) LoadDLLfunc (PeekMessageA, PeekMessageA@20, user32) LoadDLLfunc (PostMessageA, PostMessageA@16, user32) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 8ba3bc858..6c9e9b01b 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -398,7 +398,9 @@ read_sd(const char *file, PSECURITY_DESCRIPTOR sd_buf, LPDWORD sd_size) debug_printf("file = %s", file); DWORD len = 0; - if (! GetFileSecurity (file, + char fbuf[PATH_MAX]; + OemToChar(file, fbuf); + if (! GetFileSecurity (fbuf, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, @@ -407,6 +409,7 @@ read_sd(const char *file, PSECURITY_DESCRIPTOR sd_buf, LPDWORD sd_size) __seterrno (); return -1; } + debug_printf("file = %s: len=%d", file, len); if (len > *sd_size) { *sd_size = len;