From 34ef36eb857af952f5c061864c05aedc2316d3d8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 13 Aug 2012 13:17:28 +0000 Subject: old std* plugins became banned, not to load them from the Plugins folder git-svn-id: http://svn.miranda-ng.org/main/trunk@1443 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdchat/src/main.cpp | 2 +- src/core/stdclist/src/init.cpp | 4 ++-- src/core/stdmsg/src/srmm.cpp | 2 +- src/modules/plugins/newplugins.cpp | 21 ++++++++++++++++++++- 4 files changed, 24 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index e9927f4442..d4a728150b 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -60,7 +60,7 @@ PLUGININFOEX pluginInfo = { __COPYRIGHT, __AUTHORWEB, UNICODE_AWARE, - {0x9d6c3213, 0x2b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe2, 0x4f, 0x8d, 0x65 }} //{9D6C3213-02B4-4fe1-92E6-526DE24F8D65} + {0x9d6c3213, 0x2b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe1, 0x4f, 0x8d, 0x65 }} //{9D6C3213-02B4-4fe1-92E6-526DE14F8D65} }; BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp index 60b3bae86e..c5cdd97b77 100644 --- a/src/core/stdclist/src/init.cpp +++ b/src/core/stdclist/src/init.cpp @@ -66,8 +66,8 @@ PLUGININFOEX pluginInfo = { __COPYRIGHT, __AUTHORWEB, UNICODE_AWARE, - //{240A91DC-9464-457a-9787-FF1EA88E77E3} - {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 }} + //{240A91DC-9464-457a-9787-FF1EA88E77E2} + {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe2 }} }; extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index dfb4c31579..731231fad7 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -38,7 +38,7 @@ PLUGININFOEX pluginInfo = { __COPYRIGHT, __AUTHORWEB, UNICODE_AWARE, - {0x657fe89b, 0xd121, 0x40c2, { 0x8a, 0xc9, 0xb9, 0xfa, 0x57, 0x55, 0xb3, 0xc }} //{657FE89B-D121-40c2-8AC9-B9FA5755B30C} + {0x657fe89b, 0xd121, 0x40c2, { 0x8a, 0xc9, 0xb9, 0xfa, 0x57, 0x55, 0xb3, 0x0D }} //{657FE89B-D121-40c2-8AC9-B9FA5755B30D} }; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index 461eca7bb1..1220e15557 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -81,6 +81,25 @@ bool hasMuuid(const BASIC_PLUGIN_INFO& bpi, const MUUID& uuid) return false; } +///////////////////////////////////////////////////////////////////////////////////////// +// banned plugins + +static const MUUID pluginBannedList[] = +{ + {0x9d6c3213, 0x02b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe2, 0x4f, 0x8d, 0x65 }}, // old chat + {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 }}, // old clist + {0x657fe89b, 0xd121, 0x40c2, { 0x8a, 0xc9, 0xb9, 0xfa, 0x57, 0x55, 0xb3, 0x0c }} // old srmm +}; + +static bool isPluginBanned(const MUUID& u1) +{ + for (int i=0; i < SIZEOF(pluginBannedList); i++) + if (equalUUID(pluginBannedList[i], u1)) + return true; + + return false; +} + ///////////////////////////////////////////////////////////////////////////////////////// // default plugins @@ -218,7 +237,7 @@ static int checkPI(BASIC_PLUGIN_INFO* bpi, PLUGININFOEX* pi) if (bpi->InfoEx == NULL || pi->cbSize != sizeof(PLUGININFOEX)) return FALSE; - if ( !validInterfaceList(bpi->Interfaces)) + if ( !validInterfaceList(bpi->Interfaces) || isPluginBanned(pi->uuid)) return FALSE; if (pi->shortName == NULL || pi->description == NULL || pi->author == NULL || -- cgit v1.2.3