(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-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
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);
}
#include "cygheap.h"
#include "registry.h"
#include "environ.h"
+#include "child_info.h"
extern BOOL allow_daemon;
extern BOOL allow_glob;
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;
/* 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},
/* 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);
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 *);
{
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;
}
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))
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)
if ( joiner == *thread)
{
if (return_val)
- *return_val = NULL;
+ *return_val = NULL;
return EDEADLK;
}
if((*thread)->attr.joinable == PTHREAD_CREATE_DETACHED)
{
if (return_val)
- *return_val = NULL;
+ *return_val = NULL;
(*thread)->mutex.UnLock ();
return EINVAL;
}
(*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 */
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
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;
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];