mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ef18c48f1 | ||
|
|
c3871caf2a | ||
|
|
f649c7d4de | ||
|
|
0a14a3bcdb | ||
|
|
17665e1f8e | ||
|
|
bf04b9465b | ||
|
|
4e92e71349 | ||
|
|
f25c501cb4 | ||
|
|
1ce4a496f6 | ||
|
|
b41d6590cb | ||
|
|
eb8522bb8f | ||
|
|
1a27fd88a9 | ||
|
|
443a4c02d0 | ||
|
|
40d03b8a4a | ||
|
|
53098814f0 | ||
|
|
8f4243ffe1 | ||
|
|
618673c335 | ||
|
|
f452009079 | ||
|
|
2b0f8bbcfc |
No files matched your search
+2
-2
@@ -14,17 +14,17 @@ tmp/
|
|||||||
*.bat
|
*.bat
|
||||||
*.swp
|
*.swp
|
||||||
*.o
|
*.o
|
||||||
3proxy.res
|
|
||||||
*.idb
|
*.idb
|
||||||
src/version.h
|
|
||||||
src/res
|
src/res
|
||||||
version.c
|
version.c
|
||||||
|
3proxy.res
|
||||||
doc/html/man3/
|
doc/html/man3/
|
||||||
doc/html/man8/
|
doc/html/man8/
|
||||||
doc/html/index.html
|
doc/html/index.html
|
||||||
*.var
|
*.var
|
||||||
verfile.sh
|
verfile.sh
|
||||||
Makefile
|
Makefile
|
||||||
|
Changelog
|
||||||
copytgz.sh
|
copytgz.sh
|
||||||
*~.nib
|
*~.nib
|
||||||
local.properties
|
local.properties
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -1,7 +1,6 @@
|
|||||||
#include "src/version.h"
|
#include "src/version.h"
|
||||||
#include "afxres.h"
|
|
||||||
|
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
LANGUAGE 0x09, 0x01
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 0,7,0,0
|
FILEVERSION 0,7,0,0
|
||||||
@@ -18,9 +17,9 @@ BEGIN
|
|||||||
VALUE "FileDescription", "3proxy - tiny proxy server"
|
VALUE "FileDescription", "3proxy - tiny proxy server"
|
||||||
VALUE "FileVersion", VERSION "-" BUILDDATE
|
VALUE "FileVersion", VERSION "-" BUILDDATE
|
||||||
VALUE "InternalName", "3proxy"
|
VALUE "InternalName", "3proxy"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2002-2009 Vladimir Dubrovin"
|
VALUE "LegalCopyright", "Copyright (C) 2002-2014 Vladimir Dubrovin"
|
||||||
VALUE "OriginalFilename", "3proxy.exe"
|
VALUE "OriginalFilename", "3proxy.exe"
|
||||||
VALUE "ProductName", "3proxy"
|
VALUE "ProductName", "3proxy - tiny proxy server"
|
||||||
VALUE "ProductVersion", VERSION
|
VALUE "ProductVersion", VERSION
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
@@ -29,4 +28,4 @@ BEGIN
|
|||||||
VALUE "Translation", 0x0, 1200
|
VALUE "Translation", 0x0, 1200
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
0 ICON DISCARDABLE "3proxy.ico"
|
||||||
+6
-2
@@ -19,7 +19,9 @@ LDFLAGS = -Wall -O2 -pthread
|
|||||||
DLFLAGS = -shared
|
DLFLAGS = -shared
|
||||||
DLSUFFICS = .ld.so
|
DLSUFFICS = .ld.so
|
||||||
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
# -lpthreads may be reuqired on some platforms instead of -pthreads
|
||||||
LIBS = -lcrypto -lssl -ldl
|
#LIBS = -lcrypto -lssl -ldl
|
||||||
|
# libcrypto and libssl are required for SSLPlugin
|
||||||
|
LIBS = -ldl
|
||||||
LNOUT = -o
|
LNOUT = -o
|
||||||
EXESUFFICS =
|
EXESUFFICS =
|
||||||
OBJSUFFICS = .o
|
OBJSUFFICS = .o
|
||||||
@@ -29,7 +31,9 @@ REMOVECOMMAND = rm -f
|
|||||||
TYPECOMMAND = cat
|
TYPECOMMAND = cat
|
||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.Linux
|
MAKEFILE = Makefile.Linux
|
||||||
PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
#PLUGINS = SSLPlugin StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||||
|
# SSLPlugin is not built by default because of external dependencies
|
||||||
|
PLUGINS = StringsPlugin TrafficPlugin PCREPlugin TransparentPlugin
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
|||||||
+9
-2
@@ -15,7 +15,8 @@ LN = link
|
|||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libeay32MT.lib ssleay32MT.lib
|
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib
|
||||||
|
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
LNOUT = /out:
|
LNOUT = /out:
|
||||||
EXESUFFICS = .exe
|
EXESUFFICS = .exe
|
||||||
@@ -27,10 +28,16 @@ TYPECOMMAND = type
|
|||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.msvc
|
MAKEFILE = Makefile.msvc
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin lastFripper FilePlugin
|
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin lastFripper FilePlugin
|
||||||
|
VERFILE = 3proxyres.obj $(VERFILE)
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
../3proxy.res:
|
||||||
|
rc /fo../3proxy.res ../3proxy.rc
|
||||||
|
|
||||||
|
3proxyres.obj: ../3proxy.res
|
||||||
|
cvtres /out:3proxyres.obj /MACHINE:X86 ../3proxy.res
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
||||||
|
|
||||||
+9
-1
@@ -15,7 +15,8 @@ LN = link
|
|||||||
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
LDFLAGS = /nologo /subsystem:console /incremental:no /machine:x64
|
||||||
DLFLAGS = /DLL
|
DLFLAGS = /DLL
|
||||||
DLSUFFICS = .dll
|
DLSUFFICS = .dll
|
||||||
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib libeay32MT.lib ssleay32MT.lib
|
LIBS = ws2_32.lib advapi32.lib odbc32.lib user32.lib kernel32.lib Gdi32.lib
|
||||||
|
LIBSOLD = libeay32MT.lib ssleay32MT.lib
|
||||||
LIBEXT = .lib
|
LIBEXT = .lib
|
||||||
LNOUT = /out:
|
LNOUT = /out:
|
||||||
EXESUFFICS = .exe
|
EXESUFFICS = .exe
|
||||||
@@ -27,9 +28,16 @@ TYPECOMMAND = type
|
|||||||
COMPATLIBS =
|
COMPATLIBS =
|
||||||
MAKEFILE = Makefile.msvc64
|
MAKEFILE = Makefile.msvc64
|
||||||
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
PLUGINS = utf8tocp1251 WindowsAuthentication TrafficPlugin StringsPlugin PCREPlugin
|
||||||
|
VERFILE = 3proxyres.obj $(VERFILE)
|
||||||
|
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
|
../3proxy.res:
|
||||||
|
rc /fo../3proxy.res ../3proxy.rc
|
||||||
|
|
||||||
|
3proxyres.obj: ../3proxy.res
|
||||||
|
cvtres /out:3proxyres.obj /MACHINE:X64 ../3proxy.res
|
||||||
|
|
||||||
allplugins:
|
allplugins:
|
||||||
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
for /D %%i in ($(PLUGINS)) do (copy Makefile plugins\%%i && copy Makefile.var plugins\%%i && cd plugins\%%i && nmake && del *.obj *.idb &&cd ..\..)
|
||||||
|
|
||||||
+23
-2
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "proxy.h"
|
#include "proxy.h"
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#include <sys/resource.h>
|
||||||
#ifndef NOPLUGINS
|
#ifndef NOPLUGINS
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -359,9 +360,8 @@ unsigned char * dologname (unsigned char *buf, unsigned char *name, const unsign
|
|||||||
|
|
||||||
memset(&fakecli, 0, sizeof(fakecli));
|
memset(&fakecli, 0, sizeof(fakecli));
|
||||||
dobuf2(&fakecli, buf, NULL, NULL, ts, (char *)name);
|
dobuf2(&fakecli, buf, NULL, NULL, ts, (char *)name);
|
||||||
return buf;
|
|
||||||
}
|
}
|
||||||
switch(lt){
|
else switch(lt){
|
||||||
case NONE:
|
case NONE:
|
||||||
sprintf((char *)buf, "%s", name);
|
sprintf((char *)buf, "%s", name);
|
||||||
break;
|
break;
|
||||||
@@ -647,6 +647,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
|||||||
childdef.isudp = 0;
|
childdef.isudp = 0;
|
||||||
childdef.service = S_PROXY;
|
childdef.service = S_PROXY;
|
||||||
childdef.helpmessage = " -n - no NTLM support\n";
|
childdef.helpmessage = " -n - no NTLM support\n";
|
||||||
|
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize)){
|
||||||
|
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, proxy may run very slow\n", linenum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(!strcmp((char *)argv[0], "pop3p")) {
|
else if(!strcmp((char *)argv[0], "pop3p")) {
|
||||||
childdef.pf = pop3pchild;
|
childdef.pf = pop3pchild;
|
||||||
@@ -675,6 +678,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
|||||||
childdef.isudp = 0;
|
childdef.isudp = 0;
|
||||||
childdef.service = S_SOCKS;
|
childdef.service = S_SOCKS;
|
||||||
childdef.helpmessage = " -n - no NTLM support\n";
|
childdef.helpmessage = " -n - no NTLM support\n";
|
||||||
|
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize)){
|
||||||
|
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, socks may run very slow\n", linenum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(!strcmp((char *)argv[0], "tcppm")) {
|
else if(!strcmp((char *)argv[0], "tcppm")) {
|
||||||
childdef.pf = tcppmchild;
|
childdef.pf = tcppmchild;
|
||||||
@@ -715,6 +721,9 @@ static int h_proxy(int argc, unsigned char ** argv){
|
|||||||
childdef.port = 53;
|
childdef.port = 53;
|
||||||
childdef.isudp = 1;
|
childdef.isudp = 1;
|
||||||
childdef.service = S_DNSPR;
|
childdef.service = S_DNSPR;
|
||||||
|
if(!resolvfunc || (resolvfunc == myresolver && !dns_table.hashsize) || resolvfunc == fakeresolver){
|
||||||
|
fprintf(stderr, "[line %d] Warning: no nserver/nscache configured, dnspr will not work as expected\n", linenum);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return start_proxy_thread(&ch);
|
return start_proxy_thread(&ch);
|
||||||
}
|
}
|
||||||
@@ -954,6 +963,18 @@ static int h_maxconn(int argc, unsigned char **argv){
|
|||||||
if(!conf.maxchild) {
|
if(!conf.maxchild) {
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
#ifndef _WIN32
|
||||||
|
{
|
||||||
|
struct rlimit rl;
|
||||||
|
if(!getrlimit(RLIMIT_NOFILE, &rl)){
|
||||||
|
if((conf.maxchild<<1) > rl.rlim_cur)
|
||||||
|
fprintf(stderr, "[line %d] Warning: current open file ulimits are too low (cur: %d/max: %d),"
|
||||||
|
" maxconn requires at least %d for every running service."
|
||||||
|
" Configure ulimits according to system documentation\n",
|
||||||
|
linenum, (int)rl.rlim_cur, (int)rl.rlim_max, (conf.maxchild<<1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
# 3 proxy common Makefile
|
# 3 proxy common Makefile
|
||||||
#
|
#
|
||||||
|
|
||||||
all: pre $(BUILDDIR)3proxy$(EXESUFFICS) $(BUILDDIR)mycrypt$(EXESUFFICS) $(BUILDDIR)dighosts$(EXESUFFICS) $(BUILDDIR)pop3p$(EXESUFFICS) $(BUILDDIR)smtpp$(EXESUFFICS) $(BUILDDIR)ftppr$(EXESUFFICS) $(BUILDDIR)tcppm$(EXESUFFICS) $(BUILDDIR)icqpr$(EXESUFFICS) $(BUILDDIR)msnpr$(EXESUFFICS) $(BUILDDIR)udppm$(EXESUFFICS) $(BUILDDIR)socks$(EXESUFFICS) $(BUILDDIR)proxy$(EXESUFFICS) $(BUILDDIR)countersutil$(EXESUFFICS) allplugins
|
all: pre $(VERFILE) $(BUILDDIR)3proxy$(EXESUFFICS) $(BUILDDIR)mycrypt$(EXESUFFICS) $(BUILDDIR)dighosts$(EXESUFFICS) $(BUILDDIR)pop3p$(EXESUFFICS) $(BUILDDIR)smtpp$(EXESUFFICS) $(BUILDDIR)ftppr$(EXESUFFICS) $(BUILDDIR)tcppm$(EXESUFFICS) $(BUILDDIR)icqpr$(EXESUFFICS) $(BUILDDIR)msnpr$(EXESUFFICS) $(BUILDDIR)udppm$(EXESUFFICS) $(BUILDDIR)socks$(EXESUFFICS) $(BUILDDIR)proxy$(EXESUFFICS) $(BUILDDIR)countersutil$(EXESUFFICS) allplugins
|
||||||
|
|
||||||
|
|
||||||
pre:
|
pre:
|
||||||
|
|||||||
-14
@@ -882,20 +882,6 @@ struct auth authfuncs[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct hashentry {
|
|
||||||
unsigned char hash[sizeof(unsigned)*4];
|
|
||||||
unsigned long value;
|
|
||||||
time_t expires;
|
|
||||||
struct hashentry *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hashtable {
|
|
||||||
unsigned hashsize;
|
|
||||||
struct hashentry ** hashtable;
|
|
||||||
struct hashentry * hashvalues;
|
|
||||||
struct hashentry * hashempty;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct hashtable dns_table = {0, NULL, NULL, NULL};
|
struct hashtable dns_table = {0, NULL, NULL, NULL};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-4
@@ -42,8 +42,6 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
if (req) myfree (req);
|
if (req) myfree (req);
|
||||||
req = NULL;
|
req = NULL;
|
||||||
|
|
||||||
(*param->srv->logfunc)(param, buf);
|
|
||||||
|
|
||||||
if (!strncasecmp((char *)buf, "OPEN ", 5)){
|
if (!strncasecmp((char *)buf, "OPEN ", 5)){
|
||||||
if(parsehostname((char *)buf+5, param, 21)){RETURN(803);}
|
if(parsehostname((char *)buf+5, param, 21)){RETURN(803);}
|
||||||
if(param->remsock != INVALID_SOCKET) {
|
if(param->remsock != INVALID_SOCKET) {
|
||||||
@@ -123,10 +121,10 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
}
|
}
|
||||||
if ((clidatasock=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN(821);}
|
if ((clidatasock=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {RETURN(821);}
|
||||||
sasize = sizeof(struct sockaddr_in);
|
sasize = sizeof(struct sockaddr_in);
|
||||||
if (pasv) {
|
|
||||||
if(so._getsockname(param->ctrlsock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
if(so._getsockname(param->ctrlsock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
||||||
param->sinc.sin_port = 0;
|
param->sinc.sin_port = 0;
|
||||||
if(so._bind(clidatasock, (struct sockaddr *)¶m->sinc, sasize)){RETURN(822);}
|
if(so._bind(clidatasock, (struct sockaddr *)¶m->sinc, sasize)){RETURN(822);}
|
||||||
|
if (pasv) {
|
||||||
if(so._listen(clidatasock, 1)) {RETURN(823);}
|
if(so._listen(clidatasock, 1)) {RETURN(823);}
|
||||||
if(so._getsockname(clidatasock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
if(so._getsockname(clidatasock, (struct sockaddr *)¶m->sinc, &sasize)){RETURN(824);}
|
||||||
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
|
sprintf((char *)buf, "227 OK (%u,%u,%u,%u,%u,%u)\r\n",
|
||||||
@@ -137,7 +135,6 @@ void * ftpprchild(struct clientparam* param) {
|
|||||||
(unsigned)(((unsigned char *)(¶m->sinc.sin_port))[0]),
|
(unsigned)(((unsigned char *)(¶m->sinc.sin_port))[0]),
|
||||||
(unsigned)(((unsigned char *)(¶m->sinc.sin_port))[1])
|
(unsigned)(((unsigned char *)(¶m->sinc.sin_port))[1])
|
||||||
);
|
);
|
||||||
param->srv->logfunc(param,buf);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
unsigned long b1, b2, b3, b4;
|
unsigned long b1, b2, b3, b4;
|
||||||
@@ -174,6 +171,7 @@ param->srv->logfunc(param,buf);
|
|||||||
!(strncasecmp((char *)buf, "RETR ", 5) && (param->operation = FTP_GET)) ||
|
!(strncasecmp((char *)buf, "RETR ", 5) && (param->operation = FTP_GET)) ||
|
||||||
!(strncasecmp((char *)buf, "LIST", 4) && (param->operation = FTP_LIST))||
|
!(strncasecmp((char *)buf, "LIST", 4) && (param->operation = FTP_LIST))||
|
||||||
!(strncasecmp((char *)buf, "NLST ", 5) && (param->operation = FTP_LIST)) ||
|
!(strncasecmp((char *)buf, "NLST ", 5) && (param->operation = FTP_LIST)) ||
|
||||||
|
!(strncasecmp((char *)buf, "MLSD", 4) && (param->operation = FTP_LIST)) ||
|
||||||
!(strncasecmp((char *)buf, "APPE ", 5) && (param->operation = FTP_PUT)) ||
|
!(strncasecmp((char *)buf, "APPE ", 5) && (param->operation = FTP_PUT)) ||
|
||||||
!(strncasecmp((char *)buf, "STOR ", 5) && (param->operation = FTP_PUT))
|
!(strncasecmp((char *)buf, "STOR ", 5) && (param->operation = FTP_PUT))
|
||||||
)){
|
)){
|
||||||
|
|||||||
@@ -105,13 +105,6 @@ int savecouters(void)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
__declspec(dllexport) int start(struct pluginlink * pluginlink,
|
__declspec(dllexport) int start(struct pluginlink * pluginlink,
|
||||||
int argc, char** argv);
|
int argc, char** argv);
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
|
||||||
DWORD ul_reason_for_call,
|
|
||||||
LPVOID lpReserved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int start(struct pluginlink * pluginlink,
|
int start(struct pluginlink * pluginlink,
|
||||||
@@ -128,6 +121,9 @@ static int ldapfunc(struct clientparam *param)
|
|||||||
int rc = -1;
|
int rc = -1;
|
||||||
char tmpbuf[1024];
|
char tmpbuf[1024];
|
||||||
|
|
||||||
|
/* test proxy user auth ------------------------*/
|
||||||
|
if(!param->username || !param->password) return 4;
|
||||||
|
if(strlen(param->password)==0) return 4;
|
||||||
|
|
||||||
/* init ldap ---------------------- */
|
/* init ldap ---------------------- */
|
||||||
ld = ldap_init( ldap_serv, 389 );
|
ld = ldap_init( ldap_serv, 389 );
|
||||||
@@ -138,9 +134,6 @@ static int ldapfunc(struct clientparam *param)
|
|||||||
return 7;
|
return 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* test proxy user auth ------------------------*/
|
|
||||||
if(!param->username || !param->password) return 4;
|
|
||||||
if(strlen(param->password)==0) return 4;
|
|
||||||
|
|
||||||
/* this code for Active Directory LDAP catalog :(
|
/* this code for Active Directory LDAP catalog :(
|
||||||
detail see documentation for plugin */
|
detail see documentation for plugin */
|
||||||
@@ -168,6 +161,14 @@ static int ldapfunc(struct clientparam *param)
|
|||||||
ldap_unbind_s(ld);
|
ldap_unbind_s(ld);
|
||||||
|
|
||||||
ld = ldap_init( ldap_serv, 389 );
|
ld = ldap_init( ldap_serv, 389 );
|
||||||
|
|
||||||
|
if ( ld == NULL )
|
||||||
|
{
|
||||||
|
param->srv->logfunc(param,"Error ldap_init: No init lib ldap");
|
||||||
|
/*ldap_perror( ld, "Error ldap_init" ); */
|
||||||
|
return 7;
|
||||||
|
}
|
||||||
|
|
||||||
rc = ldap_bind_s( ld, ldap_user, ldap_pass, LDAP_AUTH_SIMPLE );
|
rc = ldap_bind_s( ld, ldap_user, ldap_pass, LDAP_AUTH_SIMPLE );
|
||||||
|
|
||||||
if ( rc != LDAP_SUCCESS )
|
if ( rc != LDAP_SUCCESS )
|
||||||
|
|||||||
@@ -27,11 +27,6 @@ http://lucas.bergmans.us/hacks/openldap/
|
|||||||
под unix подобной ОС (Freebsd) использовался стандартный gcc.
|
под unix подобной ОС (Freebsd) использовался стандартный gcc.
|
||||||
и библиотеки openldap-client.
|
и библиотеки openldap-client.
|
||||||
|
|
||||||
!!!! Внимание при работе плагина возможна утечка памяти !!!!
|
|
||||||
У меня на Win 2000 Serv и окола 600 пользователях при канале 500 кбит/сек .
|
|
||||||
процесс 3proxy за сутки выростает до 40 мб . Лечится рестартом сервиса.
|
|
||||||
Если кто то знает хорошо Open Ldap api и может указать на ошибку в плагине
|
|
||||||
с радостью выслушаю :) .
|
|
||||||
|
|
||||||
|
|
||||||
2. Настройка плагина.
|
2. Настройка плагина.
|
||||||
@@ -328,11 +323,6 @@ http://lucas.bergmans.us/hacks/openldap/
|
|||||||
РПД unix РПДПВОПК пу (Freebsd) ЙУРПМШЪПЧБМУС УФБОДБТФОЩК gcc.
|
РПД unix РПДПВОПК пу (Freebsd) ЙУРПМШЪПЧБМУС УФБОДБТФОЩК gcc.
|
||||||
Й ВЙВМЙПФЕЛЙ openldap-client.
|
Й ВЙВМЙПФЕЛЙ openldap-client.
|
||||||
|
|
||||||
!!!! чОЙНБОЙЕ РТЙ ТБВПФЕ РМБЗЙОБ ЧПЪНПЦОБ ХФЕЮЛБ РБНСФЙ !!!!
|
|
||||||
х НЕОС ОБ Win 2000 Serv Й ПЛПМБ 600 РПМШЪПЧБФЕМСИ РТЙ ЛБОБМЕ 500 ЛВЙФ/УЕЛ .
|
|
||||||
РТПГЕУУ 3proxy ЪБ УХФЛЙ ЧЩТПУФБЕФ ДП 40 НВ . мЕЮЙФУС ТЕУФБТФПН УЕТЧЙУБ.
|
|
||||||
еУМЙ ЛФП ФП ЪОБЕФ ИПТПЫП Open Ldap api Й НПЦЕФ ХЛБЪБФШ ОБ ПЫЙВЛХ Ч РМБЗЙОЕ
|
|
||||||
У ТБДПУФША ЧЩУМХЫБА :) .
|
|
||||||
|
|
||||||
|
|
||||||
2. оБУФТПКЛБ РМБЗЙОБ.
|
2. оБУФТПКЛБ РМБЗЙОБ.
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ static int restore_old_table(void * v)
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
__declspec(dllexport) int start(struct pluginlink * pluginlink,
|
__declspec(dllexport) int start(struct pluginlink * pluginlink,
|
||||||
int argc, char** argv);
|
int argc, char** argv);
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
BOOL WINAPI DllMain( HINSTANCE hModule,
|
||||||
DWORD ul_reason_for_call,
|
DWORD ul_reason_for_call,
|
||||||
LPVOID lpReserved
|
LPVOID lpReserved
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ void mylogfunc(struct clientparam * param, const unsigned char * pz) {
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
BOOL APIENTRY DllMain( HANDLE hModule,
|
BOOL WINAPI DllMain( HINSTANCE hModule,
|
||||||
DWORD ul_reason_for_call,
|
DWORD ul_reason_for_call,
|
||||||
LPVOID lpReserved
|
LPVOID lpReserved
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,14 +20,6 @@ extern "C" {
|
|||||||
int argc, char** argv);
|
int argc, char** argv);
|
||||||
|
|
||||||
|
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
|
||||||
DWORD ul_reason_for_call,
|
|
||||||
LPVOID lpReserved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct auth alwaysauth;
|
static struct auth alwaysauth;
|
||||||
|
|
||||||
static char sidbuf[4096];
|
static char sidbuf[4096];
|
||||||
|
|||||||
@@ -18,15 +18,6 @@ extern "C" {
|
|||||||
__declspec(dllexport) int utf8tocp1251(struct pluginlink * pluginlink,
|
__declspec(dllexport) int utf8tocp1251(struct pluginlink * pluginlink,
|
||||||
int argc, char** argv);
|
int argc, char** argv);
|
||||||
|
|
||||||
|
|
||||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
|
||||||
DWORD ul_reason_for_call,
|
|
||||||
LPVOID lpReserved
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct auth alwaysauth;
|
static struct auth alwaysauth;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -132,8 +132,8 @@ char * proxy_stringtable[] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BUFSIZE 4096
|
#define LINESIZE 4096
|
||||||
#define LINESIZE 2048
|
#define BUFSIZE (LINESIZE*2)
|
||||||
|
|
||||||
static void logurl(struct clientparam * param, char * buf, char * req, int ftp){
|
static void logurl(struct clientparam * param, char * buf, char * req, int ftp){
|
||||||
char *sb;
|
char *sb;
|
||||||
@@ -339,7 +339,7 @@ for(;;){
|
|||||||
if(!isconnect){
|
if(!isconnect){
|
||||||
if(se==sg)*se-- = ' ';
|
if(se==sg)*se-- = ' ';
|
||||||
*se = '/';
|
*se = '/';
|
||||||
memcpy(ss, se, i - (se - sb) + 1);
|
memmove(ss, se, i - (se - sb) + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reqlen = i = (int)strlen((char *)buf);
|
reqlen = i = (int)strlen((char *)buf);
|
||||||
@@ -377,7 +377,7 @@ for(;;){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#ifndef NOCRYPT
|
#ifndef NOCRYPT
|
||||||
if(!strncasecmp((char *)sb, "ntlm", 4)){
|
if(param->srv->usentlm && !strncasecmp((char *)sb, "ntlm", 4)){
|
||||||
sb+=4;
|
sb+=4;
|
||||||
while(isspace(*sb))sb++;
|
while(isspace(*sb))sb++;
|
||||||
i = de64(sb, username, 1023);
|
i = de64(sb, username, 1023);
|
||||||
|
|||||||
+9
-5
@@ -460,22 +460,26 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
#else
|
#else
|
||||||
h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)32768, (BEGINTHREADFUNC)srv.pf, (void *) newparam, 0, &thread);
|
h = (HANDLE)CreateThread((LPSECURITY_ATTRIBUTES )NULL, (unsigned)32768, (BEGINTHREADFUNC)srv.pf, (void *) newparam, 0, &thread);
|
||||||
#endif
|
#endif
|
||||||
newparam->threadid = (unsigned)thread;
|
|
||||||
if (h) {
|
|
||||||
srv.childcount++;
|
srv.childcount++;
|
||||||
|
if (h) {
|
||||||
|
newparam->threadid = (unsigned)thread;
|
||||||
CloseHandle(h);
|
CloseHandle(h);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myfree(newparam);
|
sprintf((char *)buf, "_beginthreadex(): %s", _strerror(NULL));
|
||||||
|
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||||
|
freeparam(newparam);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if((error = pthread_create(&thread, &pa, (PTHREADFUNC)srv.pf, (void *)newparam))){
|
|
||||||
|
error = pthread_create(&thread, &pa, (PTHREADFUNC)srv.pf, (void *)newparam);
|
||||||
|
srv.childcount++;
|
||||||
|
if(error){
|
||||||
sprintf((char *)buf, "pthread_create(): %s", strerror(error));
|
sprintf((char *)buf, "pthread_create(): %s", strerror(error));
|
||||||
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
if(!srv.silent)(*srv.logfunc)(&defparam, buf);
|
||||||
freeparam(newparam);
|
freeparam(newparam);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
srv.childcount++;
|
|
||||||
newparam->threadid = (unsigned)thread;
|
newparam->threadid = (unsigned)thread;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ int socksendto(SOCKET sock, struct sockaddr_in * sin, unsigned char * buf, int b
|
|||||||
if(res < 1) break;
|
if(res < 1) break;
|
||||||
res = so._sendto(sock, buf + sent, bufsize - sent, 0, (struct sockaddr *)sin, sizeof(struct sockaddr_in));
|
res = so._sendto(sock, buf + sent, bufsize - sent, 0, (struct sockaddr *)sin, sizeof(struct sockaddr_in));
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
if(errno != EAGAIN) break;
|
if(errno != EAGAIN && errno != EINTR) break;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sent += res;
|
sent += res;
|
||||||
|
|||||||
+8
-4
@@ -130,7 +130,8 @@ int sockmap(struct clientparam * param, int timeo){
|
|||||||
}
|
}
|
||||||
res = so._sendto(param->clisock, param->srvbuf + param->srvoffset,(!param->waitserver || ((unsigned)param->waitserver - received) > (param->srvinbuf - param->srvoffset))? param->srvinbuf - param->srvoffset : param->waitserver - received, 0, (struct sockaddr*)¶m->sinc, sasize);
|
res = so._sendto(param->clisock, param->srvbuf + param->srvoffset,(!param->waitserver || ((unsigned)param->waitserver - received) > (param->srvinbuf - param->srvoffset))? param->srvinbuf - param->srvoffset : param->waitserver - received, 0, (struct sockaddr*)¶m->sinc, sasize);
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
if(errno != EAGAIN) return 96;
|
if(errno != EAGAIN && errno != EINTR) return 96;
|
||||||
|
if(errno == EINTR) usleep(SLEEPTIME);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
param->srvoffset += res;
|
param->srvoffset += res;
|
||||||
@@ -155,7 +156,8 @@ int sockmap(struct clientparam * param, int timeo){
|
|||||||
}
|
}
|
||||||
res = so._sendto(param->remsock, param->clibuf + param->clioffset, (!param->waitclient || ((unsigned)param->waitclient - sent) > (param->cliinbuf - param->clioffset))? param->cliinbuf - param->clioffset : param->waitclient - sent, 0, (struct sockaddr*)¶m->sins, sasize);
|
res = so._sendto(param->remsock, param->clibuf + param->clioffset, (!param->waitclient || ((unsigned)param->waitclient - sent) > (param->cliinbuf - param->clioffset))? param->cliinbuf - param->clioffset : param->waitclient - sent, 0, (struct sockaddr*)¶m->sins, sasize);
|
||||||
if(res < 0) {
|
if(res < 0) {
|
||||||
if(errno != EAGAIN) return 97;
|
if(errno != EAGAIN && errno != EINTR) return 97;
|
||||||
|
if(errno == EINTR) usleep(SLEEPTIME);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
param->clioffset += res;
|
param->clioffset += res;
|
||||||
@@ -180,7 +182,8 @@ int sockmap(struct clientparam * param, int timeo){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (res < 0){
|
if (res < 0){
|
||||||
if( errno != EAGAIN) return (94);
|
if(errno != EAGAIN && errno != EINTR) return 94;
|
||||||
|
if(errno == EINTR) usleep(SLEEPTIME);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
param->cliinbuf += res;
|
param->cliinbuf += res;
|
||||||
@@ -210,7 +213,8 @@ int sockmap(struct clientparam * param, int timeo){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (res < 0){
|
if (res < 0){
|
||||||
if( errno != EAGAIN) return (93);
|
if(errno != EAGAIN && errno != EINTR) return 93;
|
||||||
|
if(errno == EINTR) usleep(SLEEPTIME);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
param->srvinbuf += res;
|
param->srvinbuf += res;
|
||||||
|
|||||||
@@ -657,6 +657,19 @@ typedef enum {
|
|||||||
TYPE_SERVER
|
TYPE_SERVER
|
||||||
}DATA_TYPE;
|
}DATA_TYPE;
|
||||||
|
|
||||||
|
struct hashentry {
|
||||||
|
unsigned char hash[sizeof(unsigned)*4];
|
||||||
|
unsigned long value;
|
||||||
|
time_t expires;
|
||||||
|
struct hashentry *next;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct hashtable {
|
||||||
|
unsigned hashsize;
|
||||||
|
struct hashentry ** hashtable;
|
||||||
|
struct hashentry * hashvalues;
|
||||||
|
struct hashentry * hashempty;
|
||||||
|
};
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#define VERSION "3proxy-0.7.1.2"
|
||||||
|
#define BUILDDATE "150217161415"
|
||||||
+2
-2
@@ -480,9 +480,9 @@ void * adminchild(struct clientparam* param) {
|
|||||||
"<td>MB%s</td>"
|
"<td>MB%s</td>"
|
||||||
"<td>%.3f MB</td>"
|
"<td>%.3f MB</td>"
|
||||||
"<td>%s</td>",
|
"<td>%s</td>",
|
||||||
(1024.0 * (float)cp->traflimgb) + (float)cp->traflim/1048576.0,
|
(4 * 1024.0 * (float)cp->traflimgb) + (float)cp->traflim/(1024.*1024.),
|
||||||
rotations[cp->type],
|
rotations[cp->type],
|
||||||
(1024.0 * (float)cp->trafgb) + (float)cp->traf/1048576.0,
|
(4 * 1024.0 * (float)cp->trafgb) + (float)cp->traf/(1024.*1024.),
|
||||||
cp->cleared?ctime(&cp->cleared):"never"
|
cp->cleared?ctime(&cp->cleared):"never"
|
||||||
);
|
);
|
||||||
inbuf += sprintf(buf + inbuf,
|
inbuf += sprintf(buf + inbuf,
|
||||||
|
|||||||
Reference in new issue
Block a user