This is the mail archive of the cygwin-patches@sourceware.cygnus.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]

[RFD]: uinfo.cc or "all commands start soooooow slow"


In the same context I have a question to you:

> To get full informations about the user, ntsec needs the name of
> the logon domain and the logon server. To get that information,
> the function `internal_getlogin' calls NetWkstaUserGetInfo() and
> NetGetDCName(). If for some reason the machine has no connection
> to it's PDC, this may take a while.

But why are that functions called? Isn't that information
already found in the users environment?

Yes and no.

Yes, if the user is working in a console window or if s/he is
logged in via a service which runs under a regular users account.

No, if s/he is logged in via a service running under LocalSystem
account.

It would be possible to patch internal_getlogin() to do the
following:

  First try to read the environment variables
  LOGONSERVER and USERDOMAIN.

  If they exist:

    Call GetUserName().

  If they don't exist:

    If nontsec: Call GetUserName().

    If ntsec: Call NetWkstaUserGetInfo() and NetGetDCName().

      If they succeed and the username is not SYSTEM:

        Set environment variables LOGONSERVER and USERDOMAIN.

   Go ahead.

I'm sure that this algorithm would speed up also ntsec most
of the time. Above all the last part (setting the variables)
would additionally speed up further sub processes.

But the DISADVANTAGE is: If for some reason an application
or a user decides to set those environment variables to some
illegal values, ntsec would suffer a sort of nerveous breakdown.

The question: Should we try the patch, nevertheless?

Corinna

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