Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 X-AuthUser: gerrit:koeln.convey.de Date: Mon, 21 Apr 2003 22:55:41 +0200 From: "Gerrit P. Haase" Organization: Esse keine toten Tiere X-Priority: 3 (Normal) Message-ID: <176380637637.20030421225541@familiehaase.de> To: cygwin AT cygwin DOT com Subject: proftpd (was: Re: inetutils ftpd fcntl(F_SETOWN) failure message suppression patch) In-Reply-To: <20030113143459.GE1012@tishler.net> References: <20030103133222 DOT GA1712 AT tishler DOT net> <20030107150428 DOT A14974 AT cygbert DOT vinschen DOT de> <20030109164436 DOT GA1064 AT tishler DOT net> <20030109164943 DOT GA3100 AT redhat DOT com> <20030109182038 DOT G21839 AT cygbert DOT vinschen DOT de> <20030113143459 DOT GE1012 AT tishler DOT net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hallo Jason, >> Oh btw... wouldn't you better like to maintain ProFTPd for Cygwin? >> ;-) > I would consider the above, if I could get Cygwin ProFTPd to work! I > spent *way* too much time about a month or two ago attempting to get > Cygwin ProFTPd to work. Unfortunately, I was not successful and put the > port on the back burner. I will post my patch and findings if someone > is interested or I get motivated. Yes, I'm interested. It seems that there is a problem with the login. I could compile the current cvs source, the server runs, but ... I cannot login. $ ftp localhost Connected to loreley.antigone.familiehaase.de. 220 ProFTPD 1.2.9rc1 Server (ProFTPD Default Installation) [loreley.antigone.familiehaase.de] Name (localhost:Gerrit): gerrit 331 Password required for gerrit. Password: 530 Login incorrect. ftp: Login failed. Remote system type is UNIX. Using binary mode to transfer files. ftp> quit 221 Goodbye. I applied the following patch to the current source, but it seems that it is still all wrong... --- modules/mod_auth.c~ 2003-04-21 22:18:26.000000000 +0200 +++ modules/mod_auth.c 2003-04-21 22:22:18.000000000 +0200 @@ -29,14 +29,15 @@ * $Id: mod_auth.c,v 1.145 2003/04/15 06:22:24 castaglia Exp $ */ -#ifdef __CYGWIN__ -#include -#include -#endif /* __CYGWIN__ */ - #include "conf.h" #include "privs.h" +#ifdef __CYGWIN__ +# include +# include +# define is_winnt (GetVersion() < 0x80000000) +#endif /* __CYGWIN__ */ + #ifdef HAVE_REGEX_H #include #endif @@ -762,9 +762,22 @@ /* security: other functions perform pw lookups, thus we need to make * a local copy of the user just looked up */ - pw = passwd_dup(p,pw); +#ifdef __CYGWIN__ + /* We have to do special Windows NT voodoo with Cygwin in order to be + * able to switch UID/GID. More info at + * http://cygwin.com/cygwin-ug-net/ntsec.html#NTSEC-SETUID + */ + if (is_winnt) { + HANDLE hToken = cygwin_logon_user(pw, pass); + + if (hToken == INVALID_HANDLE_VALUE) + goto auth_failure; + cygwin_set_impersonation_token(hToken); + } +#endif /* __CYGWIN__ */ + if (pw->pw_uid == 0) { unsigned char *root_allow = NULL; @@ -1774,21 +1788,6 @@ } } -#ifdef __CYGWIN__ - /* We have to do special Windows NT voodoo with Cygwin in order to be - * able to switch UID/GID. More info at - * http://cygwin.com/cygwin-ug-net/ntsec.html#NTSEC-SETUID - */ - if (GetVersion() < 0x80000000) { - HANDLE token; - - if ((token = cygwin_logon_user(user, user->pw_passwd))) - goto auth_failure; - - cygwin_set_impersonation_token(token); - } -#endif /* __CYGWIN__ */ - if (c) anon_require_passwd = get_param_ptr(c->subset, "AnonRequirePassword", FALSE); #END OF PATCH Gerrit -- =^..^= -- 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/