diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-07-30 16:10:20 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-07-30 16:10:20 +0400 |
commit | b54881352d5c4d1c179726e52d00cc50f35a2080 (patch) | |
tree | 992ebd43e672facc72c850c995e713f31523d301 /winsup/cygwin/external.cc | |
parent | 79ea8bbb10421f19c016e44916124d9bb8efbeda (diff) |
* sec_auth.cc (extract_nt_dom_user): Return domain and user name as
WCHAR.
(cygwin_logon_user): Accommodate above change. Convert password to
WCHAR and call LogonUserW.
* external.cc (cygwin_internal): Accommodate above change.
* security.h (extract_nt_dom_user): Change prototype accordingly.
Diffstat (limited to 'winsup/cygwin/external.cc')
-rw-r--r-- | winsup/cygwin/external.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 429a2875a..d9ab4d578 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -28,6 +28,7 @@ details. */ #include <unistd.h> #include <stdlib.h> #include <wchar.h> +#include <iptypes.h> child_info *get_cygwin_startup_info (); @@ -254,10 +255,17 @@ cygwin_internal (cygwin_getinfo_types t, ...) } case CW_EXTRACT_DOMAIN_AND_USER: { + WCHAR nt_domain[MAX_DOMAIN_NAME_LEN + 1]; + WCHAR nt_user[UNLEN + 1]; + struct passwd *pw = va_arg (arg, struct passwd *); char *domain = va_arg (arg, char *); char *user = va_arg (arg, char *); - extract_nt_dom_user (pw, domain, user); + extract_nt_dom_user (pw, nt_domain, nt_user); + if (domain) + sys_wcstombs (domain, MAX_DOMAIN_NAME_LEN + 1, nt_domain); + if (user) + sys_wcstombs (user, UNLEN + 1, nt_user); return 0; } case CW_CMDLINE: |