This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH] base-files-4.2-1: Change prompt if running with admin rights
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin at cygwin dot com
- Date: Thu, 10 Apr 2014 17:57:00 +0200
- Subject: Re: [PATCH] base-files-4.2-1: Change prompt if running with admin rights
- Authentication-results: sourceware.org; auth=none
- References: <53458036 dot 1010307 at t-online dot de> <877g6ys69r dot fsf at Rainer dot invalid> <5345C0C0 dot 5010908 at t-online dot de> <20140410081130 dot GW2437 at calimero dot vinschen dot de>
Corinna Vinschen wrote:
On Apr 9 23:50, Christian Franke wrote:
I used the registry check in the past because it only uses shell
builtins and does not rely on specific SID->gid mappings in
Especially given that in future there might be no /etc/group to begin
But even without /etc/group, the administrator's group will have the
gid 544. I think such a test should be sufficient?
Result would only differ for special accounts like "Backup
Administrator" (has SeBackup/RestorePrivilege but is not member of local
This change for my patch uses shell builtins for the string matching:
# Set PS1a if user has admin rights
-if [ -r /proc/registry/HKEY_LOCAL_MACHINE/SECURITY ]; then
- PS1a="# "
+case " $(/usr/bin/id -G) " in
+ *\ 544\ *) PS1a="# " ;;
Works for me with bash, dash, mksh, posh, and zsh.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple