login-1.3 can't work on the recent snapshots.

Kazuhiro Fujieda fujieda@jaist.ac.jp
Wed Jul 19 23:50:00 GMT 2000


>>> On Wed, 19 Jul 2000 15:04:50 -0400
>>> Chris Faylor <cgf@cygnus.com> said:

> >login-1.3 is still using `sexec..()' of course.
> 
> I'm not sure why it is a problem even for when child == myself,
> actually.

My problem is triggered by the following code.

spawn.cc:
546:      child->uid = USHRT_MAX;
547:      child->username[0] = '\0';
548:      child->psid = NULL;
(snip)
553:      rc = CreateProcessAsUser (hToken,
554:		       real_path,	/* image name - with full path */
555:		       one_line.buf,	/* what was passed to exec */
556:                                        /* process security attrs */
557:                       allow_ntsec && sid ? sec_user (sa_buf, sid)
558:                                          : &sec_all_nih,
559:                                        /* thread security attrs */
560:                       allow_ntsec && sid ? sec_user (sa_buf, sid)
561:                                          : &sec_all_nih,

shared.cc:
204: PSECURITY_ATTRIBUTES __stdcall
205: sec_user (PVOID sa_buf, PSID sid2, BOOL inherit)
206: {
(snip)
218:   if (myself->psid)
219:     CopySid (MAX_SID_LEN, sid, myself->psid);
220:   else if (! lookup_name (getlogin (), myself->logsrv, sid))
221:     return inherit ? &sec_none_nih : &sec_none;

myself->psid has been modified to NULL at the line 548 of
spawn.cc, so getlogin is invoked at the line 220. But it can't
return the user name because myself->username has been modified
to "" at the line 547 of spawn.cc.
____
  | AIST      Kazuhiro Fujieda <fujieda@jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology


More information about the Cygwin-developers mailing list