X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <489B13F4.4030002@cwilson.fastmail.fm>
Date: Thu, 07 Aug 2008 11:25:40 -0400
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: CSIH patch (Re: Unable to run sshd under a domain sshd_server   account [SOLVED])
References: <20080513073720.GA22193@calimero.vinschen.de> <3B3EFBD49B94AD4DBB7B7097257A8046DD02FC@FDSVAST06SXCH01.flooddata.net> <20080616210105.GI731@calimero.vinschen.de> <20080616211352.GK731@calimero.vinschen.de> <48821B9F.6070907@cwilson.fastmail.fm> <20080719171235.GO5675@calimero.vinschen.de> <488252B5.8000501@cwilson.fastmail.fm> <20080720122754.GP5675@calimero.vinschen.de> <20080720134054.GQ5675@calimero.vinschen.de> <4897AD74.8020606@cwilson.fastmail.fm> <20080807075806.GA30629@calimero.vinschen.de>
In-Reply-To: <20080807075806.GA30629@calimero.vinschen.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Corinna Vinschen wrote:
> Hi Chuck,
> 
> On Aug  4 21:31, Charles Wilson wrote:
>> Corinna Vinschen wrote:
>>> Btw., there's a test for the administrators group in /etc/passwd.


>> I don't see this. I see testing /etc/passwd for the (local) Administrator 
>> USER, and testing /etc/group for the Administrators GROUP, but not 
>> /etc/passwd <-> Administrators GROUP.
>>
>> More info please?
> 
> Function csih_get_system_and_admins_ids(), last test:
> 
>   csih_ADMINSUID=$(sed -ne '/^[^:]*:[^:]*:[0-9]*:[0-9]*:[^:]*,S-1-5-32-544:.*:/{s/[^:]*:[^:]*:\([0-9]*\):.*$/\1/p;q}' /etc/passwd)
>   csih_SYSTEMUID=$(sed -ne '/^[^:]*:[^:]*:[0-9]*:[0-9]*:[^:]*,S-1-5-18:.*:/{s/[^:]*:[^:]*:\([0-9]*\):.*$/\1/p;q}' /etc/passwd)
>   if [ -z "$csih_ADMINSUID" -o -z "$csih_SYSTEMUID" ]
>   then
>     [...]
> 
> The function csih_get_system_and_admins_ids is called by
> csih_check_access() and requires the above test being successful.

Ah -- those lines are testing /etc/passwd for the Administrator USER. 
You originally said 'administrators group'. Hence my confusion.

Now, about csih_check_access() -- without exact knowledge of 
csih_ADMINSUID, csih_SYSTEMUID, csih_ADMINSGID, and csih_SYSTEMGID, then 
the whole csih_check_access() test can't be computed.

If you make those GID/UID vars "optional" (e.g. not a failure if 
missing), and then skip the relevant tests in csih_check_access, you 
might as well just abandon the test entirely.  Is that what we want to 
do?  Never bother to check for SYSTEM/Administrator access to the 
specified files?

e.g.
   /var/run
   /var/log
   /var/empty

Somehow that doesn't seem right.

--
Chuck


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

