[PATCH] base-files-4.2-1: Change prompt if running with admin rights

Corinna Vinschen corinna-cygwin@cygwin.com
Thu Apr 10 08:11:00 GMT 2014


On Apr  9 23:50, Christian Franke wrote:
> Achim Gratz wrote:
> >Christian Franke writes:
> >>Attached is an updated version of:
> >>https://sourceware.org/ml/cygwin/2012-02/msg00806.html
> >I'll put this on hold until the AD integration has landed in Cygwin
> >(which will require some larger changes anyway).
> 
> Agree.
> 
> >Generally I'd prefer to move such things that depend on personal
> >preferences like setting up prompts into profile.d where they are easier
> >to change and maintain independently from core system functionality.
> 
> The user could disable the root prompt by an "unset PS1a" in a
> profile.d script. The default behavior of Cygwin should IMO be close
> to traditional *nix behavior: Use a special (#) prompt if
> root(-like) privileges are effective.
> 
> 
> >Using the registry to check for administrative privileges is clever,
> >however I'm wondering why we shouldn't simply check via id (that's what
> >I'm doing personally at the moment).
> 
> For standard local administrator users, both would work to check for
> privilege elevation.
> 
> I used the registry check in the past because it only uses shell
> builtins and does not rely on specific SID->gid mappings in
> /etc/group.

Especially given that in future there might be no /etc/group to begin
with.

But even without /etc/group, the administrator's group will have the
gid 544.  I think such a test should be sufficient?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140410/bccb9c88/attachment.sig>


More information about the Cygwin mailing list