This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Reorganizing internal_getlogin()


At 10:28 PM 6/10/2002 -0400, Christopher Faylor wrote:
>Yes, this was one of the things that I've wanted to do for a while.
>
>It's checked in now, btw, along with your "Define sec_attribs and call
>sec_user_nih() only once" change in spawn_guts' change.

Thanks

>But, we know (in some cases, at least) if it's going to be a cygwin
>process or not.  There may be no reason to go to the effort of filling
>out the environment if we know we're not starting a normal windows
>program.

That's fine with me too. I was going for minimum impact changes.

>However, I'm not convinced that we shouldn't just set the environment
>correctly in setuid, rather than doing it in spawn_guts.  I think the normal
>use of setuid is something like:
>
>if (!fork ())
>  {
>    setuid (...);
>    exec (...);
>  }

Yes, that's typical of sshd, telnetd, etc.. and my changes
would improve that case (e.g. avoid duplications and don't 
read the passwd file in the exec'ed program. That's not 
yet apparent in what I have sent, testing it now).

But there are also many programs (e.g. mail & pop servers) 
that look like

if (!fork ())
  {
    setuid (...);
    do some work without exec
    exit(0);
  }
That's mainly what I am trying to optimize.
 
Pierre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]