X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=IuHmyR0XK2AjislO4FODMK+y29QVHVtRxWtOHPHj7Etyz5dZ11XJQ c510QRv8F9eUNrVvqYBrMFCiWnsfCZUZpL/E+YY35+5IQsh5ZLPPm5Dfekda8pXw ta6LXmB2O8skZ5tzIigxRXN9M/zUf9m04YRf/ihwUsfDcmyADJValg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; s=default; bh=VmvWsoAkKzOz20feXeSmuc92seI=; b=JauhZ3g7/UZ96YAWkA62bx3kn6h5 5/o14cnrG571HSLf9VCAwMu+INRoTg31xbuUglEP0pWNXffE2x6yyWU/7i+4SJ+t zrtmAq5LDejjimwJ4WEVz1bDEtALI1k4L91R6cpxnlX15gt8Q8eU/b5t+IRlCSnm kzeIy9xNFRMp2eE= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL,BASE64_LENGTH_79_INF,BAYES_50,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=authentication, authenticated, Authenticated, mandatory X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Brian Inglis Subject: Re: Change PS1 when run as administrator Date: Wed, 23 Mar 2016 12:35:46 +0000 (UTC) Lines: 1 Message-ID: References: <28210846 DOT 20160315202354 AT yandex DOT ru> <87mvpz1ong DOT fsf AT Rainer DOT invalid> <0F37E0B7-A313-49F2-BAFD-59A7A144BD8C AT etr-usa DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id u2NCaT9w006179 Warren Young etr-usa.com> writes: > On Mar 15, 2016, at 2:17 PM, Achim Gratz nexgo.de> wrote: >> Andrey Repin writes: >>> test $group -eq 114 && { x="#"; break; } >> Nope, that group membership isn't associated with real administrative >> powers. > Confirmed, at least on Win10 64-bit without any AD mucking things up. > That is, I get both 114 and 544 here, so I don’t need the 114 rule at all. Opposite for me on Win7 x64 non-domain machine! I am always a member of 544(Administrators) group and it is my default primary group in normal non-admin and elevated admin shells. In elevated admin shell, I am also a member of 114(Local account and member of Administrators group) and 405504(High Mandatory Level) not 401408(Medium Mandatory Level). No idea how this works in domains and with domain accounts, but perhaps checking for 114 and/or 405504 would be more portable? $ uname -srvmo CYGWIN_NT-6.1 2.4.1(0.293/5/3) 2016-01-24 11:26 x86_64 Cygwin normal non-admin shell: $ id uid=... gid=544(Administrators) groups=544(Administrators),197121(None),197610(HomeUsers),545(Users), 4(INTERACTIVE),66049(CONSOLE LOGON),11(Authenticated Users),15(This Organization),113(Local account),4095(CurrentSession),66048(LOCAL),262154(NTLM Authentication),401408(Medium Mandatory Level) elevated admin shell: $ id uid=... gid=544(Administrators) groups=544(Administrators),197121(None),114(Local account and member of Administrators group),197610(HomeUsers),545(Users),4(INTERACTIVE),66049(CONSOLE LOGON),11(Authenticated Users),15(This Organization),113(Local account),4095(CurrentSession),66048(LOCAL),262154(NTLM Authentication),405504(High Mandatory Level) This is also reflected by getent group with no args. The Windows and Cygwin groups entries are: Administrators:S-1-5-32-544:544: Local account and member of Administrators group:S-1-5-114:114: Untrusted Mandatory Level:S-1-16-0:393216: Low Mandatory Level:S-1-16-4096:397312: Medium Mandatory Level:S-1-16-8192:401408: High Mandatory Level:S-1-16-12288:405504: System Mandatory Level:S-1-16-16384:409600: