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/grp.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/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 2cd8b5eec..231501e8d 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -13,6 +13,7 @@ details. */
#include "winsup.h"
#include <grp.h>
+#include <wininet.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -28,8 +29,6 @@ details. */
/* Read /etc/group only once for better performance. This is done
on the first call that needs information from it. */
-#define MAX_DOMAIN_NAME 100
-
static NO_COPY const char *etc_group = "/etc/group";
static struct group *group_buf = NULL; /* group contents in memory */
static int curr_lines = 0;
@@ -138,8 +137,8 @@ void
read_etc_group ()
{
char linebuf [200];
- char group_name [MAX_USER_NAME];
- DWORD group_name_len = MAX_USER_NAME;
+ char group_name [UNLEN + 1];
+ DWORD group_name_len = UNLEN + 1;
strncpy (group_name, "Administrators", sizeof (group_name));
@@ -172,8 +171,8 @@ read_etc_group ()
}
else /* /etc/group doesn't exist -- create default one in memory */
{
- char domain_name [MAX_DOMAIN_NAME];
- DWORD domain_name_len = MAX_DOMAIN_NAME;
+ char domain_name [INTERNET_MAX_HOST_NAME_LENGTH + 1];
+ DWORD domain_name_len = INTERNET_MAX_HOST_NAME_LENGTH + 1;
SID_NAME_USE acType;
debug_printf ("Emulating /etc/group");
if (! LookupAccountSidA (NULL ,