[ITA] - base-files

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Feb 9 16:49:00 GMT 2011

On Feb  9 10:42, Charles Wilson wrote:
> On 2/6/2011 4:40 PM, David Sastre wrote:
> > I have a question yet: is there a consistent way of knowing
> > the GID of users with administrative privileges (from a windows
> > perspective) so that could be used to add /usr/sbin to their paths? 
> AFAIK, this requires Win32 C code.  Take a look at the code in winsec.c
> that is part of cygwin's login package -- and how it is used in login.c
> to determine Administrator membership (see "isROOT_UID()" in login,.c).
> It's possible some part of this functionality could be added to an
> executable utility in cygutils or csih, but...should base-files really
> depend on either of those packages?  Maybe instead, base-files should
> also ship some new utility .exe for this purpose in /usr/bin/?

When you call mkgroup, you have the admins group with gid 544.  It will
be in the user token and id(1) will contain it in its output.  We
should really start to rely on that.  Here's the test I'm doing:

admin=$(/usr/bin/id -G | /usr/bin/grep -Eq '\<544\>' && echo yes || echo no)

> > Would that be useful?
> Maybe, but admin user accounts can always add /usr/sbin themselves, in
> ~/.bash_profile or ~/.bashrc.  (I usually don't bother, and just invoke
> sbin progs by full path).  Dunno if it's worth the effort.

I agree.  It's an interesting idea but it costs an extra call to one or
more external applications in the profile which most users won't need.
I guess we should avoid that.


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

More information about the Cygwin-apps mailing list