From: Daniel Colascione <dan.colascione@gmail.com>
To: cygwin@cygwin.com
Subject: Re: [PATCH] base-files-4.0.6: Change prompt if running with admin rights
Date: Mon, 25 Apr 2011 14:08:00 -0000 [thread overview]
Message-ID: <4DB49339.9030909@gmail.com> (raw)
In-Reply-To: <4DB45230.4080106@t-online.de>
[-- Attachment #1: Type: text/plain, Size: 860 bytes --]
On 4/24/11 9:39 AM, Christian Franke wrote:
> On 2011-04-01, Christian Franke wrote:
>> The attached patch for /etc/profile and /etc/bash.bashrc sets a root
>> prompt ('#' instead of '$' or '%') if the shell runs with admin rights
>> (local or domain admin group).
>>
>
> Any comment so far? Wrong list ?
I like the idea, but your patch adds two subprocess invocations to the
shell startup path. Each one takes ~200ms, and we can't afford to add
any more.
Instead of examining the group list, you can use something like
local isadmin=0
[[ -w / ]] && isadmin=1
or
local isadmin=0
[[ -w /cygdrive/c ]] && isadmin=1
Of course, that test assumes that only "administrators" can write to the
drive root, and that's an imperfect proxy for administrative rights. You
get the idea though: try to perform the test in pure bash code.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2011-04-24 21:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 21:29 Christian Franke
2011-04-25 11:32 ` Christian Franke
2011-04-25 14:08 ` Daniel Colascione [this message]
2011-04-27 6:41 ` Christian Franke
2011-04-27 7:32 ` Christian Franke
2011-04-26 2:52 ` David Sastre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DB49339.9030909@gmail.com \
--to=dan.colascione@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).