diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-02-22 12:52:18 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-02-22 12:52:18 +0100 |
commit | 0b63ccd0b5cb26883d6becb196fb98e4f95d0397 (patch) | |
tree | d9c660b46e106d76c5953579eca45e49c4486cbf | |
parent | 7b6bd133ca4472f6cb8058d5e34e3c8b2af7e99a (diff) | |
parent | 1624ab03b86542a2cb02eda809303144974755f3 (diff) |
Merge insp20
-rw-r--r-- | docs/conf/helpop-full.conf.example | 14 | ||||
-rw-r--r-- | docs/conf/helpop.conf.example | 3 | ||||
-rw-r--r-- | docs/conf/modules.conf.example | 17 | ||||
-rw-r--r-- | make/template/main.mk | 7 | ||||
-rw-r--r-- | make/template/org.inspircd.plist | 4 | ||||
-rw-r--r-- | make/test/eventfd.cpp | 2 | ||||
-rw-r--r-- | make/test/kqueue.cpp | 1 | ||||
-rw-r--r-- | make/utilities.pm | 3 | ||||
-rw-r--r-- | src/coremods/core_dns.cpp | 10 | ||||
-rw-r--r-- | src/coremods/core_oper/cmd_kill.cpp | 2 | ||||
-rw-r--r-- | src/inspircd.cpp | 4 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_callerid.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_check.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_dccallow.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_hideoper.cpp | 40 | ||||
-rw-r--r-- | src/modules/m_ircv3.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_namedmodes.cpp | 9 | ||||
-rw-r--r-- | src/modules/m_nationalchars.cpp | 19 | ||||
-rw-r--r-- | win/CMakeLists.txt | 4 | ||||
-rw-r--r-- | win/inspircd_win32wrapper.h | 7 |
21 files changed, 142 insertions, 29 deletions
diff --git a/docs/conf/helpop-full.conf.example b/docs/conf/helpop-full.conf.example index 2d55d186a..b9a3392e6 100644 --- a/docs/conf/helpop-full.conf.example +++ b/docs/conf/helpop-full.conf.example @@ -379,6 +379,7 @@ Sets your name to the specified name."> OPERMOTD CHECK CLONES USERIP TLINE ALLTIME WALLOPS GLOBOPS MODENOTICE +CLOAK SETHOST SETIDENT CHGHOST CHGIDENT CHGNAME SETIDLE SWHOIS @@ -758,10 +759,9 @@ The duration may be specified in seconds, or in the format 1y2w3d4h5m6s - meaning one year, two weeks, three days, 4 hours, 5 minutes and 6 seconds. All fields in this format are optional."> -<helpop key="clearcache" value="/CLEARCACHE {servername} +<helpop key="clearcache" value="/CLEARCACHE -This command clears the DNS cache of the specified server. If no -server is specified, the local server's DNS cache will be cleared."> +This command clears the DNS cache of the local server."> <helpop key="close" value="/CLOSE @@ -783,6 +783,12 @@ Sends a notice to all users who have the given mode(s) set. If multiple mode letters are given, the notice is only sent to users who have all of them set."> +<helpop key="cloak" value="/CLOAK <host> + +Generate the cloak of a host or IP. This is useful for example when +trying to get the cloak of a user from /WHOWAS and they were not +using their cloak when they quit."> + ###################### # User/Channel Modes # ###################### @@ -818,6 +824,8 @@ who have all of them set."> hideoper module). I Hides a user's entire channel list in WHOIS from non-IRCops (requires hidechans module). + L Stops redirections done by m_redirect (mode must be + enabled in the config). R Blocks private messages from unregistered users (requires services account module). S Strips mIRC color/bold/underline codes out of private diff --git a/docs/conf/helpop.conf.example b/docs/conf/helpop.conf.example index f912e7019..20596e696 100644 --- a/docs/conf/helpop.conf.example +++ b/docs/conf/helpop.conf.example @@ -51,6 +51,7 @@ OPER"> OPERMOTD CHECK CLONES USERIP TLINE ALLTIME WALLOPS GLOBOPS MODENOTICE +CLOAK SETHOST SETIDENT CHGHOST CHGIDENT CHGNAME SETIDLE SWHOIS @@ -102,6 +103,8 @@ LOCKSERV UNLOCKSERV"> hideoper module). I Hides a user's entire channel list in WHOIS from non-IRCops (requires hidechans module). + L Stops redirections done by m_redirect (mode must be + enabled in the config). R Blocks private messages from unregistered users (requires services account module). S Strips mIRC color/bold/underline codes out of private diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 69ffb537d..ef2765c28 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -425,6 +425,9 @@ #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # Channelban: Implements extended ban j:, which stops anyone already # in a channel matching a ban like +b j:#channel*mask from joining. +# Note that by default wildcard characters * and ? are allowed in +# channel names. To disallow them, load m_channames and add characters +# 42 and 63 to denyrange (see above). #<module name="channelban"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# @@ -654,6 +657,7 @@ # length - Default duration of entries in DCCALLOW list. # action - Default action to take if no action is # specified, can be 'block' or 'allow'. +# maxentries - Max number of nicks to allow on a DCCALLOW list. # # File configuration: # pattern - The glob pattern to match against. @@ -661,7 +665,7 @@ # that matches this pattern, can be 'block' or # 'allow'. # -#<dccallow blockchat="yes" length="5m" action="block"> +#<dccallow blockchat="yes" length="5m" action="block" maxentries="20"> #<banfile pattern="*.exe" action="block"> #<banfile pattern="*.txt" action="allow"> @@ -1206,10 +1210,13 @@ # 2) Allows using custom (national) casemapping over the network. #<module name="nationalchars"> # -# file - filename of existing file in "locales" directory -# casemapping - custom value for 005 numeric (if you want it to be -# different from the filename). Set this to the name of -# the locale if you are specifying an absolute path. +# file - Location of the file which contains casemapping rules. If this +# is a relative path then it is relative to "<PWD>/../locales" +# on UNIX and "<PWD>/locales" on Windows. +# casemapping - The name of the casemapping sent to clients in the 005 +# numeric. If this is not set then it defaults to the name +# of the casemapping file unless the file name contains a +# space in which case you will have to specify it manually. #<nationalchars file="bynets/russian-w1251-charlink" casemapping="ru_RU.cp1251-charlink"> #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/make/template/main.mk b/make/template/main.mk index 3e7ee1844..cc201a126 100644 --- a/make/template/main.mk +++ b/make/template/main.mk @@ -45,6 +45,7 @@ BASE = "$(DESTDIR)@BASE_DIR@" CONPATH = "$(DESTDIR)@CONFIG_DIR@" MANPATH = "$(DESTDIR)@MANUAL_DIR@" MODPATH = "$(DESTDIR)@MODULE_DIR@" +LOGPATH = "$(DESTDIR)@LOG_DIR@" DATPATH = "$(DESTDIR)@DATA_DIR@" BINPATH = "$(DESTDIR)@BINARY_DIR@" INSTALL = install @@ -217,8 +218,8 @@ install: target exit 1; \ fi @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE) - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/data - @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)/logs + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(DATPATH) + @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(LOGPATH) @-$(INSTALL) -d -m $(INSTMODE_DIR) $(BINPATH) @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/aliases @-$(INSTALL) -d -m $(INSTMODE_DIR) $(CONPATH)/examples/modules @@ -322,4 +323,6 @@ help: @echo ' deinstall Removes the files created by "make install"' @echo +.NOTPARALLEL: + .PHONY: all target debug debug-header mod-header mod-footer std-header finishmessage install clean deinstall configureclean help diff --git a/make/template/org.inspircd.plist b/make/template/org.inspircd.plist index 07a3446b5..ae4e90916 100644 --- a/make/template/org.inspircd.plist +++ b/make/template/org.inspircd.plist @@ -22,6 +22,10 @@ </array> <key>ServiceIPC</key> <false/> + <key>StandardOutPath</key> + <string>@LOG_DIR@/launchd-stdout.log</string> + <key>StandardErrorPath</key> + <string>@LOG_DIR@/launchd-stderr.log</string> <key>UserName</key> <string>@USER@</string> <key>GroupName</key> diff --git a/make/test/eventfd.cpp b/make/test/eventfd.cpp index 980d04485..9b38b793b 100644 --- a/make/test/eventfd.cpp +++ b/make/test/eventfd.cpp @@ -1,6 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2012 William Pitcock <nenolod@dereferenced.org> + * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org> * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public diff --git a/make/test/kqueue.cpp b/make/test/kqueue.cpp index a8b9882cf..708677adf 100644 --- a/make/test/kqueue.cpp +++ b/make/test/kqueue.cpp @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org> * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public diff --git a/make/utilities.pm b/make/utilities.pm index 565ac5fff..f2d645f33 100644 --- a/make/utilities.pm +++ b/make/utilities.pm @@ -32,6 +32,7 @@ use warnings FATAL => qw(all); use Exporter 'import'; use Fcntl; use File::Path; +use File::Temp; use Getopt::Long; use POSIX; @@ -345,7 +346,7 @@ sub translate_functions($$) my $tmpfile; do { - $tmpfile = tmpnam(); + $tmpfile = File::Temp::tmpnam(); } until sysopen(TF, $tmpfile, O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW, 0700); print "(Created and executed \e[1;32m$tmpfile\e[0m)\n"; print TF $1; diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp index da468af5f..1e8bb7533 100644 --- a/src/coremods/core_dns.cpp +++ b/src/coremods/core_dns.cpp @@ -339,6 +339,10 @@ class MyManager : public Manager, public Timer, public EventHandler irc::sockets::sockaddrs myserver; + /** Maximum number of entries in cache + */ + static const unsigned int MAX_CACHE_SIZE = 1000; + static bool IsExpired(const Query& record, time_t now = ServerInstance->Time()) { const ResourceRecord& req = record.answers[0]; @@ -374,6 +378,9 @@ class MyManager : public Manager, public Timer, public EventHandler */ void AddCache(Query& r) { + if (cache.size() >= MAX_CACHE_SIZE) + cache.clear(); + // Determine the lowest TTL value and use that as the TTL of the cache entry unsigned int cachettl = UINT_MAX; for (std::vector<ResourceRecord>::const_iterator i = r.answers.begin(); i != r.answers.end(); ++i) @@ -383,6 +390,7 @@ class MyManager : public Manager, public Timer, public EventHandler cachettl = rr.ttl; } + cachettl = std::min(cachettl, (unsigned int)5*60); ResourceRecord& rr = r.answers.front(); // Set TTL to what we've determined to be the lowest rr.ttl = cachettl; @@ -393,7 +401,7 @@ class MyManager : public Manager, public Timer, public EventHandler public: DNS::Request* requests[MAX_REQUEST_ID+1]; - MyManager(Module* c) : Manager(c), Timer(3600, true) + MyManager(Module* c) : Manager(c), Timer(5*60, true) { for (unsigned int i = 0; i <= MAX_REQUEST_ID; ++i) requests[i] = NULL; diff --git a/src/coremods/core_oper/cmd_kill.cpp b/src/coremods/core_oper/cmd_kill.cpp index e6b41382c..4a0cb2f28 100644 --- a/src/coremods/core_oper/cmd_kill.cpp +++ b/src/coremods/core_oper/cmd_kill.cpp @@ -117,7 +117,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User u->Write(":%s KILL %s :%s!%s!%s (%s)", ServerInstance->Config->HideKillsServer.empty() ? user->GetFullHost().c_str() : ServerInstance->Config->HideKillsServer.c_str(), u->nick.c_str(), ServerInstance->Config->ServerName.c_str(), - user->dhost.c_str(), + ServerInstance->Config->HideKillsServer.empty() ? user->dhost.c_str() : ServerInstance->Config->HideKillsServer.c_str(), ServerInstance->Config->HideKillsServer.empty() ? user->nick.c_str() : ServerInstance->Config->HideKillsServer.c_str(), parameters[1].c_str()); diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 69aa2619c..eb24cdea0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -649,11 +649,11 @@ void InspIRCd::Run() /* Allow a buffer of two seconds drift on this so that ntpdate etc dont harass admins */ if (TIME.tv_sec < OLDTIME - 2) { - SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %lu secs.", (unsigned long)OLDTIME-TIME.tv_sec); + SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %lu secs.", (unsigned long)(OLDTIME-TIME.tv_sec)); } else if (TIME.tv_sec > OLDTIME + 2) { - SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is jumping FORWARDS! Clock skipped %lu secs.", (unsigned long)TIME.tv_sec - OLDTIME); + SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is jumping FORWARDS! Clock skipped %lu secs.", (unsigned long)(TIME.tv_sec - OLDTIME)); } OLDTIME = TIME.tv_sec; diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 8d786cc3f..6a653dded 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -59,7 +59,7 @@ #endif #ifdef _WIN32 -# pragma comment(lib, "libgnutls-28.lib") +# pragma comment(lib, "libgnutls-30.lib") #endif /* $CompileFlags: pkgconfincludes("gnutls","/gnutls/gnutls.h","") eval("print `libgcrypt-config --cflags | tr -d \r` if `pkg-config --modversion gnutls 2>/dev/null | tr -d \r` lt '2.12'") */ diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index c844ef04f..0eb208138 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -89,7 +89,12 @@ struct CallerIDExtInfo : public ExtensionItem if (format == FORMAT_NETWORK) return; + void* old = get_raw(container); + if (old) + this->free(old); callerid_data* dat = new callerid_data; + set_raw(container, dat); + irc::commasepstream s(value); std::string tok; if (s.GetToken(tok)) @@ -107,10 +112,6 @@ struct CallerIDExtInfo : public ExtensionItem } } } - - void* old = set_raw(container, dat); - if (old) - this->free(old); } callerid_data* get(User* user, bool create) diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 6f9c32fb1..22dcf730f 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -213,7 +213,7 @@ class CommandCheck : public Command /* /check on a channel */ user->SendText(checkstr + " timestamp " + timestring(targchan->age)); - if (targchan->topic[0] != 0) + if (!targchan->topic.empty()) { /* there is a topic, assume topic related information exists */ user->SendText(checkstr + " topic " + targchan->topic); diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 93fddf813..0e57896f3 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -58,6 +58,7 @@ class CommandDccallow : public Command DCCAllowExt& ext; public: + unsigned int maxentries; CommandDccallow(Module* parent, DCCAllowExt& Ext) : Command(parent, "DCCALLOW", 0) , ext(Ext) @@ -142,6 +143,12 @@ class CommandDccallow : public Command ul.push_back(user); } + if (dl->size() >= maxentries) + { + user->WriteNumeric(996, "%s :Too many nicks on DCCALLOW list", user->nick.c_str()); + return CMD_FAILURE; + } + for (dccallowlist::const_iterator k = dl->begin(); k != dl->end(); ++k) { if (k->nickname == target->nick) @@ -453,6 +460,9 @@ class ModuleDCCAllow : public Module void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE { + ConfigTag* tag = ServerInstance->Config->ConfValue("dccallow"); + cmd.maxentries = tag->getInt("maxentries", 20); + bfl.clear(); ConfigTagList tags = ServerInstance->Config->ConfTags("banfile"); for (ConfigIter i = tags.first; i != tags.second; ++i) diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index 9f40d702e..03f6745ee 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -26,19 +26,37 @@ class HideOper : public SimpleUserModeHandler { public: + size_t opercount; + HideOper(Module* Creator) : SimpleUserModeHandler(Creator, "hideoper", 'H') + , opercount(0) { oper = true; } + + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string& parameter, bool adding) + { + if (SimpleUserModeHandler::OnModeChange(source, dest, channel, parameter, adding) == MODEACTION_DENY) + return MODEACTION_DENY; + + if (adding) + opercount++; + else + opercount--; + + return MODEACTION_ALLOW; + } }; class ModuleHideOper : public Module, public Whois::LineEventListener { HideOper hm; + bool active; public: ModuleHideOper() : Whois::LineEventListener(this) , hm(this) + , active(false) { } @@ -47,6 +65,28 @@ class ModuleHideOper : public Module, public Whois::LineEventListener return Version("Provides support for hiding oper status with user mode +H", VF_VENDOR); } + void OnUserQuit(User* user, const std::string&, const std::string&) CXX11_OVERRIDE + { + if (user->IsModeSet(hm)) + hm.opercount--; + } + + ModResult OnNumeric(User* user, unsigned int numeric, const std::string& text) CXX11_OVERRIDE + { + if (numeric != 252 || active || user->HasPrivPermission("users/auspex")) + return MOD_RES_PASSTHRU; + + // If there are no visible operators then we shouldn't send the numeric. + size_t opercount = ServerInstance->Users->all_opers.size() - hm.opercount; + if (opercount) + { + active = true; + user->WriteNumeric(252, "%lu :operator(s) online", opercount); + active = false; + } + return MOD_RES_DENY; + } + ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE { /* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the diff --git a/src/modules/m_ircv3.cpp b/src/modules/m_ircv3.cpp index 5275e9bd5..9e94e556d 100644 --- a/src/modules/m_ircv3.cpp +++ b/src/modules/m_ircv3.cpp @@ -160,7 +160,7 @@ class ModuleIRCv3 : public Module, public AccountEventListener { // Send the away notify line if the current member is local, has the away-notify cap and isn't excepted User* member = IS_LOCAL(it->first); - if ((member) && (cap_awaynotify.get(member)) && (last_excepts.find(member) == last_excepts.end())) + if ((member) && (cap_awaynotify.get(member)) && (last_excepts.find(member) == last_excepts.end()) && (it->second != memb)) { member->Write(line); } diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index 1735df924..617ee43b3 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -30,7 +30,12 @@ static void DisplayList(User* user, Channel* channel) continue; items << " +" << mh->name; if (mh->GetNumParams(true)) - items << " " << channel->GetModeParameter(mh); + { + if ((mh->name == "key") && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) + items << " <key>"; + else + items << " " << channel->GetModeParameter(mh); + } } const std::string line = ":" + ServerInstance->Config->ServerName + " 961 " + user->nick + " " + channel->name; user->SendText(line, items); @@ -64,6 +69,8 @@ class CommandProp : public Command while (i < parameters.size()) { std::string prop = parameters[i++]; + if (prop.empty()) + continue; bool plus = prop[0] != '-'; if (prop[0] == '+' || prop[0] == '-') prop.erase(prop.begin()); diff --git a/src/modules/m_nationalchars.cpp b/src/modules/m_nationalchars.cpp index b3937b4a4..8e836c407 100644 --- a/src/modules/m_nationalchars.cpp +++ b/src/modules/m_nationalchars.cpp @@ -271,11 +271,19 @@ class ModuleNationalChars : public Module { ConfigTag* tag = ServerInstance->Config->ConfValue("nationalchars"); charset = tag->getString("file"); - casemapping = tag->getString("casemapping", charset); + casemapping = tag->getString("casemapping", FileSystem::GetFileName(charset)); + if (casemapping.find(' ') != std::string::npos) + throw ModuleException("<nationalchars:casemapping> must not contain any spaces!"); +#if defined _WIN32 + if (!FileSystem::StartsWithWindowsDriveLetter(charset)) + charset.insert(0, "./locales/"); +#else if(charset[0] != '/') charset.insert(0, "../locales/"); +#endif unsigned char * tables[8] = { m_additional, m_additionalMB, m_additionalUp, m_lower, m_upper, m_additionalUtf8, m_additionalUtf8range, m_additionalUtf8interval }; - loadtables(charset, tables, 8, 5); + if (!loadtables(charset, tables, 8, 5)) + throw ModuleException("The locale file failed to load. Check your log file for more information."); forcequit = tag->getBool("forcequit"); CheckForceQuit("National character set changed"); CheckRehash(); @@ -320,13 +328,13 @@ class ModuleNationalChars : public Module } /*so Bynets Unreal distribution stuff*/ - void loadtables(std::string filename, unsigned char ** tables, unsigned char cnt, char faillimit) + bool loadtables(std::string filename, unsigned char ** tables, unsigned char cnt, char faillimit) { std::ifstream ifs(ServerInstance->Config->Paths.PrependConfig(filename).c_str()); if (ifs.fail()) { ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "loadtables() called for missing file: %s", filename.c_str()); - return; + return false; } for (unsigned char n=0; n< cnt; n++) @@ -341,11 +349,12 @@ class ModuleNationalChars : public Module if (loadtable(ifs, tables[n], 255) && (n < faillimit)) { ServerInstance->Logs->Log(MODNAME, LOG_DEFAULT, "loadtables() called for illegal file: %s (line %d)", filename.c_str(), n+1); - return; + return false; } } makereverse(m_additional, m_reverse_additional, sizeof(m_additional)); + return true; } unsigned char symtoi(const char *t,unsigned char base) diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt index 3cfe9f6b8..768270696 100644 --- a/win/CMakeLists.txt +++ b/win/CMakeLists.txt @@ -78,6 +78,10 @@ install(FILES ${EXTRA_DLLS} DESTINATION .) file(GLOB_RECURSE EXAMPLE_CONFIGS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIRCD_BASE}/docs/conf/*.example") install(FILES ${EXAMPLE_CONFIGS} DESTINATION conf) +# Install nationalchars files +file(GLOB_RECURSE EXAMPLE_LOCALES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${INSPIRCD_BASE}/locales/*") +install(FILES ${EXAMPLE_LOCALES} DESTINATION locales) + # Create an empty data and logs directory and install them file(MAKE_DIRECTORY ${DATA_DIR}) install(DIRECTORY ${DATA_DIR} DESTINATION .) diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index 2218d9300..d65d4eb92 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -58,6 +58,7 @@ /* Disable the deprecation warnings.. it spams :P */ #define _CRT_SECURE_NO_DEPRECATE +#define _WINSOCK_DEPRECATED_NO_WARNINGS /* Normal windows (platform-specific) includes */ #include <winsock2.h> @@ -96,9 +97,11 @@ CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, soc #define inet_pton insp_inet_pton #define inet_ntop insp_inet_ntop -/* Safe printf functions aren't defined in VC++ */ +/* Safe printf functions aren't defined in VC++ releases older than v14 */ +#if _MSC_VER <= 1800 #define snprintf _snprintf #define vsnprintf _vsnprintf +#endif #ifndef va_copy #define va_copy(dest, src) (dest = src) @@ -149,11 +152,13 @@ struct DIR bool first; }; +#if _MSC_VER <= 1800 struct timespec { time_t tv_sec; long tv_nsec; }; +#endif CoreExport DIR * opendir(const char * path); CoreExport dirent * readdir(DIR * handle); |