diff -urN /usr/home/skylord/ports/old/verlihub/Makefile Makefile --- /usr/home/skylord/ports/old/verlihub/Makefile 2009-01-12 01:49:26.000000000 +0300 +++ Makefile 2009-07-18 18:09:25.000000000 +0400 @@ -6,13 +6,12 @@ # PORTNAME= verlihub -DISTVERSION= 0.9.8d-RC2 -PORTREVISION= 3 +DISTVERSION= 0.9.8e-r1 PORTEPOCH= 1 CATEGORIES= net-p2p MASTER_SITES= SF -MAINTAINER= skylord@vt.net.ru +MAINTAINER= me@skylord.ru COMMENT= A Direct Connect protocol server (Hub) # XXX: Actually, bash isn't required for building, @@ -24,6 +23,7 @@ USE_RC_SUBR= verlihub +USE_GCC= 4.2+ USE_AUTOTOOLS= libtool:15 USE_MYSQL= yes GNU_CONFIGURE= yes @@ -31,23 +31,10 @@ USE_OPENSSL= yes SUB_FILES+= pkg-message -DOCS= configuring.txt using.txt help.html verlihub.html -MANUAL_DOCS= verlihub.css verlihub_manual.html -PORTDOCS= ${DOCS} ${MANUAL_DOCS} - -post-extract: - @${MV} ${WRKDIR}/${PORTNAME} ${WRKSRC} +post-patch: + @${REINPLACE_CMD} -e 's|for libpath in /|for libpath in ${PREFIX} /|g' ${WRKSRC}/config_geoip post-install: -.if !defined(NOPORTDOCS) - @${MKDIR} ${DOCSDIR} -.for i in ${DOCS} - ${INSTALL_DATA} ${WRKSRC}/docs/${i} ${DOCSDIR} -.endfor -.for i in ${MANUAL_DOCS} - ${INSTALL_DATA} ${WRKSRC}/docs/html_manual/${i} ${DOCSDIR} -.endfor -.endif @${CAT} ${PKGMESSAGE} .include diff -urN /usr/home/skylord/ports/old/verlihub/distinfo distinfo --- /usr/home/skylord/ports/old/verlihub/distinfo 2008-02-08 19:45:27.000000000 +0300 +++ distinfo 2009-07-18 12:02:16.000000000 +0400 @@ -1,3 +1,3 @@ -MD5 (verlihub-0.9.8d-RC2.tar.gz) = 0824be2cf3af08ccda1638c5d5d0bc4e -SHA256 (verlihub-0.9.8d-RC2.tar.gz) = baf64574d0ed89324b6b2da35d32ebb5fd9af164c83b10bdf45a49b8a8f0fc59 -SIZE (verlihub-0.9.8d-RC2.tar.gz) = 1095383 +MD5 (verlihub-0.9.8e-r1.tar.gz) = 663ef7254b79d382c3943e5c0409b640 +SHA256 (verlihub-0.9.8e-r1.tar.gz) = 1b3e981717f5e0c972778f48918ba54cb1a4b833426854c8e3eb295effc2c01d +SIZE (verlihub-0.9.8e-r1.tar.gz) = 729317 diff -urN /usr/home/skylord/ports/old/verlihub/files/patch-CVE-2008-5706 files/patch-CVE-2008-5706 --- /usr/home/skylord/ports/old/verlihub/files/patch-CVE-2008-5706 2009-01-11 22:42:13.000000000 +0300 +++ files/patch-CVE-2008-5706 1970-01-01 03:00:00.000000000 +0300 @@ -1,82 +0,0 @@ ---- src/ctrigger.cpp.orig 2005-04-11 19:18:38.000000000 +0400 -+++ src/ctrigger.cpp 2008-12-27 23:28:14.000000000 +0300 -@@ -7,6 +7,9 @@ - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - ***************************************************************************/ -+#include -+#include -+#include - #include "cserverdc.h" - #include "ctrigger.h" - #include "cconndc.h" -@@ -44,16 +47,33 @@ - { - string buf, filename, sender; - string par1, end1, parall; -+ string cmdl; -+ - if (conn && conn->mpUser) - { -+ cmd_line >> cmdl; -+ /* Sanitise user input if we're going to exec anything */ -+ if (mFlags & eTF_EXECUTE && server.mDBConf.allow_exec) { -+ string cleaned = string(); -+ const string toclean = string(";\"'\\`:!${}[]&><|~/"); -+ -+ for (string::iterator i = cmdl.begin(); -+ i < cmdl.end(); -+ i++) { -+ if (toclean.find(*i) == string::npos) -+ cleaned.append(1, *i); -+ } -+ cmdl = cleaned; -+ } -+ - int uclass = conn->mpUser->mClass; - if ((uclass >= this->mMinClass) &&(uclass <= this->mMaxClass)) { - -- if(cmd_line.str().size() > mCommand.size()) { -- parall.assign(cmd_line.str(),mCommand.size()+1,string::npos); -+ if(cmdl.size() > mCommand.size()) { -+ parall.assign(cmdl,mCommand.size()+1,string::npos); - } -- cmd_line >> par1; -- end1 = cmd_line.str(); -+ par1 = cmdl; -+ end1 = cmdl; - - sender = server.mC.hub_security; - if (mSendAs.size()) sender = mSendAs; -@@ -104,14 +124,25 @@ - - if (mFlags & eTF_EXECUTE && server.mDBConf.allow_exec) { - string command(buf); -- filename = server.mConfigBaseDir; -- filename.append("/tmp/trigger.tmp"); -- command.append(" > "); -- command.append(filename); -+ char buffer[1024]; -+ FILE *stream; -+ - cout << command << endl; -- system(command.c_str()); - buf = ""; -- if (!LoadFileInString(filename,buf)) return 0; -+ stream = popen(command.c_str(), "r"); -+ if (stream == NULL) { -+ cout << strerror(errno) << std::endl; -+ return 0; -+ } else { -+ while (fgets(buffer, sizeof(buffer), -+ stream) != NULL) -+ buf.append(buffer); -+ if (pclose(stream) == -1) { -+ cout << strerror(errno) << -+ std::endl; -+ return 0; -+ } -+ } - } - - // @CHANGED by dReiska +BEGINS+ diff -urN /usr/home/skylord/ports/old/verlihub/files/patch-db_charset files/patch-db_charset --- /usr/home/skylord/ports/old/verlihub/files/patch-db_charset 2008-02-08 19:45:27.000000000 +0300 +++ files/patch-db_charset 1970-01-01 03:00:00.000000000 +0300 @@ -1,83 +0,0 @@ ---- src/cdbconf.cpp Thu Apr 8 02:16:21 2004 -+++ src/cdbconf.cpp Thu Oct 12 16:57:43 2006 -@@ -18,6 +18,7 @@ - Add("db_user",db_user,string("verlihub")); - Add("db_pass",db_pass,string("")); - Add("db_data",db_data,string("verlihub")); -+ Add("db_charset",db_charset,string("latin1")); - Add("config_name",config_name,string("config")); - Add("lang_name",lang_name,string("lang_en")); - Load(); - -diff -Nur verlihub-orig/src/cdbconf.h verlihub/src/cdbconf.h ---- src/cdbconf.h 2006-07-15 18:42:52.000000000 +0400 -+++ src/cdbconf.h 2006-07-15 18:43:50.000000000 +0400 -@@ -31,6 +31,7 @@ - string db_user; - string db_pass; - string db_data; -+ string db_charset; - string config_name; - string lang_name; - bool allow_exec; -diff -Nur verlihub-orig/src/cmysql.cpp verlihub/src/cmysql.cpp ---- src/cmysql.cpp.orig Sun Jun 24 00:11:33 2007 -+++ src/cmysql.cpp Tue Jan 29 16:39:29 2008 -@@ -19,10 +19,10 @@ - /*! - \fn nMySQL::cMySQL::cMySQL(string&host,string&user,string&pass,string&data) - */ --cMySQL::cMySQL(string&host,string&user,string&pass,string&data) : cObj("cMySQL") -+cMySQL::cMySQL(string&host,string&user,string&pass,string&data,string&charset) : cObj("cMySQL") - { - Init(); -- if(!Connect(host,user,pass,data)) -+ if(!Connect(host,user,pass,data,charset)) - { - throw "Mysql connection error."; - } -@@ -40,12 +40,13 @@ - if(!mDBHandle) Error(0, string("Can't init mysql structure :(.: ")); - } - --bool cMySQL::Connect(string &host, string &user, string &pass, string &data) -+bool cMySQL::Connect(string &host, string &user, string &pass, string &data, string &charset) - { - if(Log(1)) LogStream() << "Connecting to mysql server: " -- << user << "@" << host << "/" << data << endl; -+ << user << "@" << host << "/" << data << "with charset " << charset << endl; - - mysql_options(mDBHandle,MYSQL_OPT_COMPRESS,0); -+ mysql_options(mDBHandle,MYSQL_SET_CHARSET_NAME,charset.c_str()); - - if(!mysql_real_connect( - mDBHandle, -diff -Nur verlihub-orig/src/cmysql.h verlihub/src/cmysql.h ---- src/cmysql.h 2006-07-15 18:42:52.000000000 +0400 -+++ src/cmysql.h 2006-07-15 18:43:50.000000000 +0400 -@@ -34,10 +34,10 @@ - friend class cQuery; - public: - cMySQL(); -- cMySQL(string&host,string&user,string&pass,string&data); -+ cMySQL(string&host,string&user,string&pass,string&data,string&charset); - ~cMySQL(); - void Init(); -- bool Connect(string &host, string &user, string &passwd, string &db); -+ bool Connect(string &host, string &user, string &passwd, string &db, string &charset); - public: void Error(int level, string text); - - private: -diff -Nur verlihub-orig/src/cserverdc.cpp verlihub/src/cserverdc.cpp ---- src/cserverdc.cpp 2006-07-15 18:42:52.000000000 +0400 -+++ src/cserverdc.cpp 2006-07-15 18:43:50.000000000 +0400 -@@ -72,7 +72,8 @@ - mDBConf.db_host, - mDBConf.db_user, - mDBConf.db_pass, -- mDBConf.db_data), // connect to mysql -+ mDBConf.db_data, -+ mDBConf.db_charset), // connect to mysql - mC(*this), // create the config object - mL(*this), - mSetupList(mMySQL), diff -urN /usr/home/skylord/ports/old/verlihub/files/patch-plugins files/patch-plugins --- /usr/home/skylord/ports/old/verlihub/files/patch-plugins 2006-12-11 00:18:10.000000000 +0300 +++ files/patch-plugins 1970-01-01 03:00:00.000000000 +0300 @@ -1,45 +0,0 @@ -diff -ruN src-orig/cpluginloader.cpp src/cpluginloader.cpp ---- src-orig/cpluginloader.cpp Fri Oct 1 15:19:44 2004 -+++ src/cpluginloader.cpp Thu Oct 12 17:16:22 2006 -@@ -40,6 +40,12 @@ - */ - bool nPlugin::cPluginLoader::Open() - { -+ /* -+ * Reset dlerror() since it can contain error from previous -+ * call to dlopen()/dlsym(). -+ */ -+ dlerror(); -+ - mHandle = dlopen(mFileName.c_str(), RTLD_NOW); - if(!mHandle || IsError()) // NOTE hte OR (||) operator evaluates only the first statement if that one is true - { -@@ -99,6 +105,12 @@ - */ - void * nPlugin::cPluginLoader::LoadSym(const char *name) - { -+ /* -+ * Reset dlerror() since it can contain error from previous -+ * call to dlopen()/dlsym(). -+ */ -+ dlerror(); -+ - void *func = dlsym( mHandle, name); - if(IsError()) - { -diff -ruN src-orig/tpluginbase.cpp src/tpluginbase.cpp ---- src-orig/tpluginbase.cpp Fri Oct 1 15:19:44 2004 -+++ src/tpluginbase.cpp Thu Oct 12 17:16:39 2006 -@@ -34,6 +34,12 @@ - */ - bool nPlugin::tPluginBase::Open() - { -+ /* -+ * Reset dlerror() since it can contain error from previous -+ * call to dlopen()/dlsym(). -+ */ -+ dlerror(); -+ - mHandle = dlopen(mFileName.c_str(), RTLD_NOW); - if(!mHandle) - { diff -urN /usr/home/skylord/ports/old/verlihub/files/patch-thublink files/patch-thublink --- /usr/home/skylord/ports/old/verlihub/files/patch-thublink 2008-02-08 19:45:27.000000000 +0300 +++ files/patch-thublink 2009-07-18 13:30:29.000000000 +0400 @@ -100,21 +100,6 @@ cMessageParser *cAsyncConn::CreateParser() { if (this->mxProtocol != NULL) -Index: casyncsocketserver.cpp -=================================================================== -RCS file: /cvsroot/verlihub/verlihub/src/casyncsocketserver.cpp,v -retrieving revision 1.70 -diff -u -r1.70 casyncsocketserver.cpp ---- src/casyncsocketserver.cpp 27 Mar 2006 13:37:32 -0000 1.70 -+++ src/casyncsocketserver.cpp 17 Jun 2006 21:27:43 -0000 -@@ -198,6 +198,7 @@ - return; - } - tCLIt it = old_conn->mIterator;//find(mConnList.begin(), mConnList.end(), old_conn); -+ - cAsyncConn *found=(*it); - if( (it == mConnList.end()) || (found != old_conn) ) - { Index: cconndc.cpp =================================================================== RCS file: /cvsroot/verlihub/verlihub/src/cconndc.cpp,v @@ -164,7 +149,7 @@ diff -u -r1.235 cserverdc.cpp --- src/cserverdc.cpp 8 Nov 2005 07:51:23 -0000 1.235 +++ src/cserverdc.cpp 17 Jun 2006 21:27:44 -0000 -@@ -492,7 +492,7 @@ +@@ -505,7 +505,7 @@ } int count=0; @@ -173,7 +158,7 @@ { conn=(cConnDC *)(*i); if(conn && conn->ok && conn->mWritable && conn->mpUser && conn->mpUser->mInList) -@@ -516,7 +516,7 @@ +@@ -529,7 +529,7 @@ cConnDC *conn; tCLIt i; int counter = 0; @@ -182,16 +167,16 @@ { conn=(cConnDC *)(*i); if( -@@ -541,7 +541,7 @@ - static string str; +@@ -555,7 +555,7 @@ cConnDC *conn; tCLIt i; + int counter = 0; - for(i=mConnList.begin(); i!= mConnList.end(); i++) + for(i=mDCConnList.begin(); i!= mDCConnList.end(); i++) { conn=(cConnDC *)(*i); if( -@@ -563,6 +563,9 @@ +@@ -579,6 +579,9 @@ /** return negative if conn should be removed */ int cServerDC::OnNewConn(cAsyncConn *nc) { @@ -201,7 +186,7 @@ cConnDC *conn = (cConnDC *)nc; stringstream errmsg,os; if(!conn) return -1; -@@ -909,7 +912,7 @@ +@@ -925,7 +928,7 @@ /** return true if accept is allowed - override */ bool cServerDC::AllowNewConn() { @@ -210,7 +195,7 @@ } int cServerDC::SaveFile(const string &file, const string &text) -@@ -1268,6 +1271,7 @@ +@@ -1280,6 +1283,7 @@ delete work; return 0; } diff -urN /usr/home/skylord/ports/old/verlihub/files/pkg-message.in files/pkg-message.in --- /usr/home/skylord/ports/old/verlihub/files/pkg-message.in 2007-07-03 14:32:36.000000000 +0400 +++ files/pkg-message.in 2009-07-18 18:07:56.000000000 +0400 @@ -1,12 +1,15 @@ -------------------------------------------------------------------- -Documentation has been installed in %%DOCSDIR%%/. - Scripts and the executable have been installed in %%PREFIX%%/bin/. This port requires a working MySQL server installation, either locally or remotely. +Visit http://www.verlihub-project.org/ for the project's homepage, +manual, forums, scripts and etc. + +INSTALLATION + Once you have a properly-running MySQL server, please run install script: @@ -14,8 +17,15 @@ and follow the instructions given. -Visit http://www.verlihub-project.org/ for the project's homepage -or http://www.verlihubforums.com/ for the project's forums. The -verlihub manual is available at http://www.danomac.org/verlihub/. +UPGRADE + +If you upgrade from version prior to 0.9.8e please note the +following: + + - Database charset is now set explicitly to UTF8 - velihub + will alter all tables during the first run. So if you have + used custom charset you should deal with it (backup, i.e.) + before the first run! + - You need to rerun vh_install as during the first installation ------------------------------------------------------------------- diff -urN /usr/home/skylord/ports/old/verlihub/pkg-plist pkg-plist --- /usr/home/skylord/ports/old/verlihub/pkg-plist 2007-07-04 17:07:48.000000000 +0400 +++ pkg-plist 2009-07-18 12:54:44.000000000 +0400 @@ -27,6 +27,8 @@ include/verlihub/cconnpoll.h include/verlihub/cconnselect.h include/verlihub/cconntypes.h +include/verlihub/ccustomredirect.h +include/verlihub/ccustomredirects.h include/verlihub/cdbconf.h include/verlihub/cdcclients.h include/verlihub/cdccommand.h @@ -85,10 +87,6 @@ include/verlihub/tmysqlmemorylist.h include/verlihub/tmysqlmemoryordlist.h include/verlihub/tpluginbase.h -lib/libdiakritika_pi.a -lib/libdiakritika_pi.la -lib/libdiakritika_pi.so -lib/libdiakritika_pi.so.0 lib/libplug_pi.a lib/libplug_pi.la lib/libplug_pi.so