diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-06-18 21:41:52 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-06-18 21:41:52 +0400 |
commit | b1c17593f84f0d0ca9c5939fb86616822c4c689a (patch) | |
tree | 3b30be686ed6c91365eef519e7b64a00c1e40b3d /winsup/cygwin/uinfo.cc | |
parent | 59c45c44452f6f56e454bb4f022dba054ca58a3a (diff) |
* ldap.cc (CYG_LDAP_TIMEOUT): Define as timeout value. Set to 30 secs
for now. Use throughout.
* uinfo.cc (colon_to_semicolon): New local function.
(pwdgrp::fetch_account_from_windows): Convert all colons in AD gecos
entry to commas.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index 9c9428f64..2b91835f1 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -1162,6 +1162,16 @@ fetch_posix_offset (PDS_DOMAIN_TRUSTSW td, cyg_ldap *cldap) return td->PosixOffset; } +/* Helper function to replace colons with commas in pw_gecos field. */ +static PWCHAR +colon_to_semicolon (PWCHAR str) +{ + PWCHAR cp = str; + while ((cp = wcschr (cp, L':')) != NULL) + *cp++ = L';'; + return str; +} + /* CV 2014-05-08: USER_INFO_24 is not yet defined in Mingw64, but will be in the next release. For the time being, define the structure here with another name which won't collide with the upcoming correct definition @@ -1597,8 +1607,9 @@ pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap) if ((id_val = cldap->get_primary_gid ()) != ILLEGAL_GID) gid = posix_offset + id_val; if ((val = cldap->get_gecos ())) - gecos = wcscpy ((PWCHAR) alloca ((wcslen (val) + 1) - * sizeof (WCHAR)), val); + gecos = colon_to_semicolon ( + wcscpy ((PWCHAR) alloca ((wcslen (val) + 1) + * sizeof (WCHAR)), val)); if ((val = cldap->get_home ())) home = wcscpy ((PWCHAR) alloca ((wcslen (val) + 1) * sizeof (WCHAR)), val); |