This is the mail archive of the cygwin-apps 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: uw-imap-imapd: suggestions for cyg_server issue


On Feb 11 23:11, Shaddy Baddah wrote:
> Hi Pierre,
> 
> On 11/02/2010 10:39 PM, Pierre A. Humblet wrote:
> >The problem you will run into is that 544 can be changed (e.g. to 0).
> >It's better to do it learn it dynamically.
> >The following is from the cron package source code.
> <snip>
> 
> Thanks for that. Yes, I have a similar patch I made in my experimental
> branch. I make one, IMO, slightly stronger assumption (than having a
> fixed RID) that enables the check to be all POSIX.
> 
> I assume that the correct SID is always in the password field for both
> passwd and group. I then search for these files for the SIDs of SYSTEM
> user and Administrators group. The checks from there are the same.

Alternatively:

  getgroups();
  for all gids
    gr = getgrgid();
    if (!strcasecmp (gr->gr_passwd, "S-1-32-544"))
      return is_admin;
  return non_admin;


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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