Date: Wed, 24 Aug 2016 04:43:11 +0000 (UTC) From: Kurt Jaeger <pi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420760 - in head/net/3proxy: . files Message-ID: <201608240443.u7O4hBli039512@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pi Date: Wed Aug 24 04:43:11 2016 New Revision: 420760 URL: https://svnweb.freebsd.org/changeset/ports/420760 Log: net/3proxy: fix ftppr - See also: https://github.com/z3APA3A/3proxy/issues/68 PR: 209463 Submitted by: emz@norma.perm.ru Approved by: Pavel Timofeev <timp87@gmail.com> (maintainer) Added: head/net/3proxy/files/patch-src_common.c (contents, props changed) head/net/3proxy/files/patch-src_ftp.c (contents, props changed) Modified: head/net/3proxy/Makefile Modified: head/net/3proxy/Makefile ============================================================================== --- head/net/3proxy/Makefile Wed Aug 24 04:17:52 2016 (r420759) +++ head/net/3proxy/Makefile Wed Aug 24 04:43:11 2016 (r420760) @@ -4,6 +4,7 @@ PORTNAME= 3proxy PORTVERSION= 0.8.6 DISTVERSIONPREFIX= ${PORTNAME}- +PORTREVISION= 1 CATEGORIES= net MAINTAINER= timp87@gmail.com Added: head/net/3proxy/files/patch-src_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/3proxy/files/patch-src_common.c Wed Aug 24 04:43:11 2016 (r420760) @@ -0,0 +1,12 @@ +--- src/common.c.orig 2016-08-24 03:41:59 UTC ++++ src/common.c +@@ -692,8 +692,8 @@ int doconnect(struct clientparam * param + #else + fcntl(param->remsock,F_SETFL,O_NONBLOCK); + #endif +- size = sizeof(param->sinsl); + } ++ size = sizeof(param->sinsl); + if(so._getsockname(param->remsock, (struct sockaddr *)¶m->sinsl, &size)==-1) {return (15);} + } + return 0; Added: head/net/3proxy/files/patch-src_ftp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/3proxy/files/patch-src_ftp.c Wed Aug 24 04:43:11 2016 (r420760) @@ -0,0 +1,40 @@ +--- src/ftp.c.orig 2016-08-24 03:43:37 UTC ++++ src/ftp.c +@@ -174,6 +174,7 @@ SOCKET ftpdata(struct clientparam *param + SOCKET s = INVALID_SOCKET, rem; + unsigned long b1, b2, b3, b4; + unsigned short b5, b6; ++ SASIZETYPE sasize; + + if(socksend(param->remsock, (unsigned char *)"PASV\r\n", 6, conf.timeouts[STRING_S]) != 6){ + return INVALID_SOCKET; +@@ -187,15 +188,27 @@ SOCKET ftpdata(struct clientparam *param + buf[i-2] = 0; + if(!(sb = strchr(buf+4, '(')) || !(se= strchr(sb, ')'))) return INVALID_SOCKET; + if(sscanf(sb+1, "%lu,%lu,%lu,%lu,%hu,%hu", &b1, &b2, &b3, &b4, &b5, &b6)!=6) return INVALID_SOCKET; ++ sasize = sizeof(param->sinsl); ++ if(so._getsockname(param->remsock, (struct sockaddr *)¶m->sinsl, &sasize)){return INVALID_SOCKET;} ++ sasize = sizeof(param->sinsr); ++ if(so._getpeername(param->remsock, (struct sockaddr *)¶m->sinsr, &sasize)){return INVALID_SOCKET;} + rem = param->remsock; + param->remsock = INVALID_SOCKET; + param->req = param->sinsr; + *SAPORT(¶m->req) = *SAPORT(¶m->sinsr) = htons((unsigned short)((b5<<8)^b6)); ++ *SAPORT(¶m->sinsl) = 0; + i = param->operation; + param->operation = FTP_DATA; + if((param->res = (*param->srv->authfunc)(param))) { +- param->remsock = rem; +- return INVALID_SOCKET; ++ if(param->remsock != INVALID_SOCKET) { ++ so._closesocket(param->remsock); ++ param->remsock = INVALID_SOCKET; ++ } ++ memset(¶m->sinsl, 0, sizeof(param->sinsl)); ++ if((param->res = (*param->srv->authfunc)(param))) { ++ param->remsock = rem; ++ return INVALID_SOCKET; ++ } + } + param->operation = i; + s = param->remsock;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608240443.u7O4hBli039512>