--- uinfo.cc.in Mon Nov 5 01:09:10 2001 +++ uinfo.cc Mon Jan 28 20:24:54 2002 @@ -127,13 +127,12 @@ NetApiBufferFree (ui); } - if (allow_ntsec) - { + HANDLE ptok = user.token; /* Which is INVALID_HANDLE_VALUE if no impersonation took place. */ DWORD siz; cygsid tu; - int ret = 0; + ret = 0; /* Try to get the SID either from already impersonated token or from current process first. To differ that two cases is @@ -190,19 +189,13 @@ else unsetenv ("USERPROFILE"); } - } /* If this process is started from a non Cygwin process, - set token owner to the same value as token user and - primary group to the group which is set as primary group - in /etc/passwd. */ + set token owner to the same value as token user */ if (ptok != INVALID_HANDLE_VALUE && myself->ppid == 1) { if (!SetTokenInformation (ptok, TokenOwner, &tu, sizeof tu)) debug_printf ("SetTokenInformation(TokenOwner): %E"); - if (gsid && !SetTokenInformation (ptok, TokenPrimaryGroup, - &gsid, sizeof gsid)) - debug_printf ("SetTokenInformation(TokenPrimaryGroup): %E"); } /* Close token only if it's a result from OpenProcessToken(). */ @@ -256,9 +249,9 @@ if ((p = internal_getlogin (cygheap->user)) != NULL) { myself->uid = p->pw_uid; - /* Set primary group only if ntsec is off or the process has been + /* Set primary group only if the process has been started from a non cygwin process. */ - if (!allow_ntsec || myself->ppid == 1) + if ( myself->ppid == 1) myself->gid = p->pw_gid; } else