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:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=CEOzY xEtP0RNFH+NhEmqsd2pBKni3QZ7iqdIYskPt1mQ1XNjTwY3LpqsAvvFN25SLAfNa ldFpR3Khwx9uE94HbBY32uKHZWGjXeJyKtnSQBNZ6SYrMC1UYx2QBNKgYVEc//Et iw4p6yAbgvHAzwJIxeH5MwJHJOEqkZAh/wQM4Y= 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:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=pk3VngoMhrw GiHI2kuphbJ0NxMU=; b=uk/SCBtkGoUbIcu6G0npWycyEX/n/4lddxXzmApfHWf 2v7gIEt5/n2XXDSpeUn56nSGv5FHqHa8KkcCrr/MQXCJtDAbhpM9MJ8weSWaieKa 6Wis+1hSc8sFcB0W8R9iUXKfdNh7/NGotUM3c+el/tFOb/udd/QQrB706CU+904s = 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=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-in-02.arcor-online.net X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-18.arcor-online.net 3kdH7P4vxhzZV99 From: Achim Gratz To: cygwin AT cygwin DOT com Subject: Re: how to determine if a shell is running as Administrator? References: <20150205100349 DOT GS2635 AT calimero DOT vinschen DOT de> Date: Thu, 05 Feb 2015 12:08:29 +0100 In-Reply-To: <20150205100349.GS2635@calimero.vinschen.de> (Corinna Vinschen's message of "Thu, 5 Feb 2015 11:03:49 +0100") Message-ID: <87siekhaz6.fsf@Rainer.invalid> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Corinna Vinschen writes: >> 2. Parse the output of groups or id -G. I can't find any reliable way to do >> this. For example on my host, when I start a shell with "Run as administrator", >> the new group I get isn't 544 (Administrators). It's 114 (Local account and >> member of Administrators group). Is that at all portable or reliable? > > Huh? There is no such group in Windows. Where does it come from? Yes there is, at least on Windows 8.1N Core and Server 2012R2. In fact there are two new SID: 113 (Local account) 114 (Local account and member in Administrators group) http://blogs.technet.com/b/secguide/archive/2014/09/02/blocking-remote-use-of-local-accounts.aspx https://msdn.microsoft.com/en-us/library/cc980032.aspx Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds -- 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