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:
authorChristopher Faylor <me@cgf.cx>2002-06-21 09:01:17 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-21 09:01:17 +0400
commit7c02f861e3512fac608b411cb5be43a41ba8735e (patch)
tree56618ecd163acfa86ea2c7dcd5a484cd0b9e3c5b
parenta7b23a8f11b2e1f2ef333d2ed95d1c972acad12f (diff)
* uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
(cygheap_user::env_logsrv): Verify env_domain is valid. * environ.cc: Include child_info.h and keep spenvs[] sorted. (environ_init): Check child_proc_info instead of myself->ppid_handle.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/cygheap.cc2
-rw-r--r--winsup/cygwin/environ.cc7
-rw-r--r--winsup/cygwin/external.cc2
-rw-r--r--winsup/cygwin/security.cc8
-rw-r--r--winsup/cygwin/thread.cc6
-rw-r--r--winsup/cygwin/uinfo.cc6
7 files changed, 23 insertions, 15 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 037123ecd..fc0b451b0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2002-06-20 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
+ (cygheap_user::env_logsrv): Verify env_domain is valid.
+ * environ.cc: Include child_info.h and keep spenvs[] sorted.
+ (environ_init): Check child_proc_info instead of myself->ppid_handle.
+
2002-06-19 Christopher Faylor <cgf@redhat.com>
* fhandler.cc (fhandler_base::set_flags): Change priority of "linked
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 9b0a2a24a..0522255f6 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -460,7 +460,7 @@ cygheap_user::set_sid (PSID new_sid)
if (new_sid)
{
if (!psid)
- psid = cmalloc (HEAP_STR, MAX_SID_LEN);
+ psid = cmalloc (HEAP_STR, MAX_SID_LEN);
if (psid)
return CopySid (MAX_SID_LEN, psid, new_sid);
}
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 1b3ff4f28..9fc4d0ab8 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -25,6 +25,7 @@ details. */
#include "cygheap.h"
#include "registry.h"
#include "environ.h"
+#include "child_info.h"
extern BOOL allow_daemon;
extern BOOL allow_glob;
@@ -712,7 +713,7 @@ environ_init (char **envp, int envc)
char *eq;
if ((eq = strchr (newp, '=')) == NULL)
eq = strchr (newp, '\0');
- if (!myself->ppid_handle)
+ if (!child_proc_info)
ucenv (newp, eq);
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
sawTERM = 1;
@@ -765,8 +766,8 @@ char env_dontadd[] = "";
/* Keep this list in upper case and sorted */
static NO_COPY spenv spenvs[] =
{
- {NL ("HOMEPATH="), &cygheap_user::env_homepath},
{NL ("HOMEDRIVE="), &cygheap_user::env_homedrive},
+ {NL ("HOMEPATH="), &cygheap_user::env_homepath},
{NL ("LOGONSERVER="), &cygheap_user::env_logsrv},
{NL ("SYSTEMDRIVE="), NULL},
{NL ("SYSTEMROOT="), NULL},
@@ -809,7 +810,7 @@ spenv::retrieve (bool no_envblock, const char *const envname)
/* Calculate (potentially) value for given environment variable. */
p = (cygheap->user.*from_cygheap) ();
if (!p || (no_envblock && !envname))
- return env_dontadd;
+ return env_dontadd;
char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1);
strcpy (s, name);
(void) strcpy (s + namelen, p);
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index bc61027a0..1dad1e70f 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -234,7 +234,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
return p ? p->dwProcessId : 0;
}
case CW_EXTRACT_DOMAIN_AND_USER:
- {
+ {
struct passwd *pw = va_arg (arg, struct passwd *);
char *domain = va_arg (arg, char *);
char *user = va_arg (arg, char *);
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index 6f27b46f4..473e62ff9 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -268,7 +268,7 @@ get_logon_server (const char *domain, char *server, WCHAR *wserver)
{
server[0] = server[1] = '\\';
if (wserver)
- sys_mbstowcs (wserver, server, INTERNET_MAX_HOST_NAME_LENGTH + 1);
+ sys_mbstowcs (wserver, server, INTERNET_MAX_HOST_NAME_LENGTH + 1);
return TRUE;
}
@@ -512,7 +512,7 @@ get_group_sidlist (cygsidlist &grp_list,
else
{
if (!get_logon_server (domain, server, wserver))
- return FALSE;
+ return FALSE;
if (my_grps)
{
if (sid_in_token_groups (my_grps, well_known_local_sid))
@@ -544,8 +544,8 @@ get_group_sidlist (cygsidlist &grp_list,
auth_pos = grp_list.count - 1;
}
if (!get_user_groups (wserver, grp_list, user, domain) ||
- !get_user_local_groups (grp_list, usersid))
- return FALSE;
+ !get_user_local_groups (grp_list, usersid))
+ return FALSE;
}
/* special_pgrp true if pgrpsid is not null and not in normal groups */
if (!pgrpsid)
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index cc24fdca6..1ea5e18b2 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -1588,7 +1588,7 @@ __pthread_join (pthread_t *thread, void **return_val)
if ( joiner == *thread)
{
if (return_val)
- *return_val = NULL;
+ *return_val = NULL;
return EDEADLK;
}
@@ -1597,7 +1597,7 @@ __pthread_join (pthread_t *thread, void **return_val)
if((*thread)->attr.joinable == PTHREAD_CREATE_DETACHED)
{
if (return_val)
- *return_val = NULL;
+ *return_val = NULL;
(*thread)->mutex.UnLock ();
return EINVAL;
}
@@ -1608,7 +1608,7 @@ __pthread_join (pthread_t *thread, void **return_val)
(*thread)->mutex.UnLock ();
WaitForSingleObject ((*thread)->win32_obj_id, INFINITE);
if (return_val)
- *return_val = (*thread)->return_ptr;
+ *return_val = (*thread)->return_ptr;
// cleanup
delete (*thread);
} /*End if */
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 0eb7892b1..fe9e30db7 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -49,7 +49,7 @@ internal_getlogin (cygheap_user &user)
else if (!GetTokenInformation (ptok, TokenUser, &tu, sizeof tu, &siz))
system_printf ("GetTokenInformation(): %E");
else if (!(ret = user.set_sid (tu)))
- system_printf ("Couldn't retrieve SID from access token!");
+ system_printf ("Couldn't retrieve SID from access token!");
/* We must set the user name, uid and gid.
If we have a SID, try to get the corresponding Cygwin
password entry. Set user name which can be different
@@ -251,7 +251,7 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw)
WCHAR wlogsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3];
sys_mbstowcs (wlogsrv, env_logsrv (),
sizeof (wlogsrv) / sizeof(*wlogsrv));
- sys_mbstowcs (wuser, name (), sizeof (wuser) / sizeof (*wuser));
+ sys_mbstowcs (wuser, env_name (), sizeof (wuser) / sizeof (*wuser));
if (!(ret = NetUserGetInfo (wlogsrv, wuser, 3,(LPBYTE *)&ui)))
{
char *p;
@@ -304,7 +304,7 @@ cygheap_user::env_logsrv ()
if (plogsrv)
return plogsrv;
- if (strcasematch (env_name (), "SYSTEM"))
+ if (!env_domain () || strcasematch (env_name (), "SYSTEM"))
return NULL;
char logsrv[INTERNET_MAX_HOST_NAME_LENGTH + 3];