This is the mail archive of the cygwin-apps@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: ntsec patch for setup


Pierre A. Humblet wrote:
> At 06:25 PM 1/19/2003 -0000, Max Bowsher wrote:
>> Pierre A. Humblet wrote:
>> It would probably be nice to add some logging to the success case,
>> so its easier to see that it has actually taken effect.
>
> OK. Good idea. I don't mind doing it but you know better
> what formats to use etc.. to fit with the rest. Let me
> know how you want to proceed.

Formats? What formats? :-) Setup has already has some badly punctuated /
badly spelt log strings. Anyway, I'd suggest something like this:

if (isusers)
{
    nsid = usid;
    log(LOG_TIMESTAMP) << "Changing gid to Users" << endLog;
}
else if (isadmins)
    nsid = asid;

    log(LOG_TIMESTAMP) << "Changing gid to Administrators" << endLog;
}

>> I don't understand this code:
>> +  isadmins = isadmins || EqualSid(groups->Groups[pg].Sid, asid);
>> +  isusers = isusers || EqualSid(groups->Groups[pg].Sid, usid);
>>
>> If I'm reading it right, isadmins and isusers were initialized as
>> false several lines above, and not touched since - so why not a
>> direct assignment?
>
> That's in the pg loop. So the effect is to set isadmins or isusers
> to true if the admins or users sids are found anywhere in the token
> groups. A direct assignment would in effect only consider the last
> sid in the groups array.

*I must pay more attention!*

Max.


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