delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/26/17:32:42

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
Message-ID: <4DB739E6.10301@t-online.de>
Date: Tue, 26 Apr 2011 23:32:22 +0200
From: Christian Franke <Christian DOT Franke AT t-online DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.17) Gecko/20110123 SeaMonkey/2.0.12
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: [PATCH] base-files-4.0.6: Change prompt if running with admin rights
References: <4D964392 DOT 6080809 AT t-online DOT de> <4DB45230 DOT 4080106 AT t-online DOT de> <4DB49339 DOT 9030909 AT gmail DOT com> <4DB73858 DOT 8070401 AT t-online DOT de>
In-Reply-To: <4DB73858.8070401@t-online.de>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

--------------050004080304070303000501
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Christian Franke wrote:
> A test script for all shells is attached. Run with admin rights. 
> Requires cygdrop from cygutils package.
>
Now it is attached :-)


--------------050004080304070303000501
Content-Type: text/plain;
 name="admtest.sh.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="admtest.sh.txt"

#!/bin/sh

#f=/proc/registry/HKEY_LOCAL_MACHINE/SAM/SAM
f=/proc/registry/HKEY_LOCAL_MACHINE/SECURITY

           /bin/test -r $f || echo "test: false negative"
cygdrop -- /bin/test -r $f && echo "test: false positive"

for shell in bash zsh mksh posh dash; do
             /bin/$shell -c "[ -r $f ]" || echo "$shell: false negative"
  cygdrop -- /bin/$shell -c "[ -r $f ]" && echo "$shell: false positive"
done



--------------050004080304070303000501
Content-Type: text/plain; charset=us-ascii

--
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
--------------050004080304070303000501--

- Raw text -


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