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>2001-04-30 22:21:48 +0400
committerCorinna Vinschen <corinna@vinschen.de>2001-04-30 22:21:48 +0400
commit17db110558a7f06c5c7fec8f998449c1e8a9f598 (patch)
treed97e40d63ebb7e4dcf4ae1ace8425e272c726101 /winsup/cygwin/uinfo.cc
parentc0a45b92ccab6ddab9482d436a1ebfe3af387fed (diff)
* grp.cc: Eliminate MAX_DOMAIN_NAME define.
(read_etc_group): Substitute MAX_DOMAIN_NAME by INTERNET_MAX_HOST_NAME_LENGTH. * passwd.cc (parse_pwd): Don't force pw_name to be lower case. * sec_helper.cc: Substitute MAX_USER_NAME by UNLEN, MAX_COMPUTERNAME_LENGTH by INTERNET_MAX_HOST_NAME_LENGTH throughout. (lookup_name): Slight cleanup. * security.cc (alloc_sd): Substitute MAX_USER_NAME by UNLEN. * security.h: Define DEFAULT_UID as DOMAIN_USER_RID_ADMIN and DEFAULT_GID as DOMAIN_ALIAS_RID_ADMINS. * shared.cc (memory_init): Substitute MAX_USER_NAME by UNLEN. * thread.h: Ditto. * uinfo.cc (internal_getlogin): Substitute MAX_USER_NAME by UNLEN. Substitute MAX_COMPUTERNAME_LENGTH and MAX_HOST_NAME by INTERNET_MAX_HOST_NAME_LENGTH. * winsup.h: Include lmcons.h. Eliminate MAX_USER_NAME and MAX_HOST_NAME. Move DEFAULT_UID and DEFAULT_GID to security.h.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index c7b97e374..3706e4a7d 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -12,6 +12,7 @@ details. */
#include <pwd.h>
#include <unistd.h>
#include <winnls.h>
+#include <wininet.h>
#include <utmp.h>
#include <limits.h>
#include <stdlib.h>
@@ -29,8 +30,8 @@ details. */
struct passwd *
internal_getlogin (cygheap_user &user)
{
- char username[MAX_USER_NAME];
- DWORD username_len = MAX_USER_NAME;
+ char username[UNLEN + 1];
+ DWORD username_len = UNLEN + 1;
struct passwd *pw = NULL;
if (!user.name ())
@@ -62,19 +63,19 @@ internal_getlogin (cygheap_user &user)
{
char buf[512];
- sys_wcstombs (buf, wui->wkui1_username, MAX_USER_NAME);
+ sys_wcstombs (buf, wui->wkui1_username, UNLEN + 1);
user.set_name (buf);
- sys_wcstombs (buf, wui->wkui1_logon_server, MAX_HOST_NAME);
+ sys_wcstombs (buf, wui->wkui1_logon_server, INTERNET_MAX_HOST_NAME_LENGTH + 1);
user.set_logsrv (buf);
sys_wcstombs (buf, wui->wkui1_logon_domain,
- MAX_COMPUTERNAME_LENGTH + 1);
+ INTERNET_MAX_HOST_NAME_LENGTH + 1);
user.set_domain (buf);
/* Save values in environment */
if (!strcasematch (user.name (), "SYSTEM")
&& user.domain () && user.logsrv ())
{
LPUSER_INFO_3 ui = NULL;
- WCHAR wbuf[MAX_HOST_NAME + 2];
+ WCHAR wbuf[INTERNET_MAX_HOST_NAME_LENGTH + 2];
strcat (strcpy (buf, "\\\\"), user.logsrv ());
setenv ("USERNAME", user.name (), 1);
@@ -82,7 +83,7 @@ internal_getlogin (cygheap_user &user)
setenv ("USERDOMAIN", user.domain (), 1);
/* HOMEDRIVE and HOMEPATH are wrong most of the time, too,
after changing user context! */
- sys_mbstowcs (wbuf, buf, MAX_HOST_NAME + 2);
+ sys_mbstowcs (wbuf, buf, INTERNET_MAX_HOST_NAME_LENGTH + 2);
if (!NetUserGetInfo (NULL, wui->wkui1_username, 3, (LPBYTE *)&ui)
|| !NetUserGetInfo (wbuf,wui->wkui1_username,3,(LPBYTE *)&ui))
{
@@ -237,7 +238,7 @@ getlogin (void)
#ifdef _MT_SAFE
char *this_username=_reent_winsup ()->_username;
#else
- static NO_COPY char this_username[MAX_USER_NAME];
+ static NO_COPY char this_username[UNLEN + 1];
#endif
return strcpy (this_username, cygheap->user.name ());