Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
X-Authenticated: #312426
Message-ID: <42DCFCE6.9010505@gmx.net>
Date: Tue, 19 Jul 2005 15:15:18 +0200
From: "H. Henning Schmidt" <hhschmidt@gmx.net>
Reply-To: henning@hhschmidt.de
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: verify login info on Windows
References: <42DC0DA5.6060402@gmx.net> <Pine.GSO.4.61.0507181729490.19690@slinky.cs.nyu.edu>
In-Reply-To: <Pine.GSO.4.61.0507181729490.19690@slinky.cs.nyu.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0



Igor Pechtchanski wrote:

>On Mon, 18 Jul 2005, H. Henning Schmidt wrote:
>
>  
>
>>I am developing a server application that accepts logins from a client
>>over a proprietary protocol.
>>I want to let clients login (username/password) before allowing anything
>>else.  I want to let them use username/password information as it is
>>stored in the regular system user database, so I do not need to maintain
>>another such database.  On Unix this would be /etc/passwd or
>>/etc/shadoww and the associated libraray calls.
>>
>>However, on my Cygwin box, the /etc/passwd (as created by mkpasswd) does
>>not contain the password. Instead the appropriate field reads
>>unused_by_nt. After googling along for a while I have understood that
>>this is done so that the real login/security info can be maintained by
>>the regular windows system.  Fine. But how do I get to it? I have not
>>found any example/explanation that answers this question:
>>
>>given two const char* variables user and password, how can I find out if
>>this combination is a valid login on this current Windows/Cygwin box?
>>
>>This might be a pute Windows issue (as oposed to Cygwin) ... however,
>>with a Linux-only knowledge of system calls, I have no clue how to
>>approach this anyways.
>>    
>>
>
>How about looking at the source of some program that actually does such
>authentication?  Searching for the string "cygwin" in auth-passwd.c in
>openssh sources is one approach.
>	Igor
>  
>
Thank you for this hint. So cygwin_logon_user() is the call I need.
Apparently this is one of the hidden cygwin_*() functions that are *not* 
documented in the API docs (http://cygwin.com/cygwin-api/cygwin-api.html).
Easy enough to use though.
;Henning

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

