This is the mail archive of the cygwin 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: Set root shell prompt in /etc/profile ?


Christian Franke wrote on Friday, September 04, 2009 5:00 PM:

> When running as member of admin group a Cygwin process normally has
> root-like privileges. But this fact cannot be checked with 'geteuid()
==
> 0'. The shell never sets the default root prompt '#', except if the
user
> is mapped to uid 0 in /etc/passwd.
> 
> Is there a generic way to set '#' via /etc/profile ?
> 
> The attached patch works for me on Cygwin 1.7., but it relies on a
> runtime file write check.
> (It also requires ACL support in /tmp and would not work on 1.5).
> 
> Is there a better way to do this?
> 
> Christian

Perhaps `groups | grep Administrators` ?

-- 
Bryan Thrall
FlightSafety International
bryan.thrall@flightsafety.com

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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