X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Subject: RE: Set root shell prompt in /etc/profile ?
Date: Fri, 4 Sep 2009 17:07:22 -0500
Message-ID: <786EBDA1AC46254B813E200779E7AD363B02F8@srv1163ex1.flightsafety.com>
In-Reply-To: <4AA18DE9.50800@t-online.de>
References: <4AA18DE9.50800@t-online.de>
From: "Thrall, Bryan" <bryan.thrall@flightsafety.com>
To: <cygwin@cygwin.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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()
=3D=3D
> 0'. The shell never sets the default root prompt '#', except if the
user
> is mapped to uid 0 in /etc/passwd.
>=20
> Is there a generic way to set '#' via /etc/profile ?
>=20
> 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).
>=20
> Is there a better way to do this?
>=20
> Christian

Perhaps `groups | grep Administrators` ?

--=20
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

