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()


On Wed, Jun 12, 2002 at 11:39:05PM -0400, Pierre A. Humblet wrote:
>That's a good thing.  I am curious to see how.  I was hitting the fact
>that once you are impersonated LookupAccountSid won't work properly, so
>spawn_guts was the latest moment I could use it.

Btw, I don't claim to have solved any sid-related problems.  I probably
introduced some problems, in fact.  I was just trying to set up a
framework in which you or Corinna could work by introducing
(essentially) environment variable callbacks.  I was also trying to
avoid unnecessary multiple passes through the environment.

Reexamining what you did in spawn_guts, it looks like there may still be
a need to call the environment builder in two separate places.  One
before CreateProcess and one immediately before CreateProcessAsUser.
That's not happening now.

I have a first stab at a modified version of your patch below.  I tried
to keep to the letter of your patch except where I disagreed with
formatting or commenting.  The one thing missing is plugging some of the
missing environment variable info in for LOGONSERVER and USERDOMAIN.
It's too late for me to think about that.

Stupid question time: Do we *really* need to set these environment
variables?  What would break if we just didn't set them?  I can't
imagine any well-written software relying on these being set correctly.
How can you rely on something that a user could modify?  I know that
cygwin did/does in some cases, but it almost looks like it was doing it
just so that they could be passed on to subprocesses.

I wouldn't be adverse to just wiping them out in the setuid case unless
there was a really good reason not to do so.

cgf

Attachment: p
Description: Text document


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