delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/04/18:08:02

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
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 DOT 50800 AT t-online DOT de>
From: "Thrall, Bryan" <bryan DOT thrall AT flightsafety DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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 DOT thrall AT flightsafety DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019