]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge pull request #1147 from SaberUK/insp20+gcc6
authorAttila Molnar <attilamolnar@hush.com>
Mon, 29 Feb 2016 11:40:21 +0000 (12:40 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Mon, 29 Feb 2016 11:40:21 +0000 (12:40 +0100)
[2.0] Fix GCC 6 warning about null checking this.

docs/conf/inspircd.conf.example
include/configreader.h
make/template/main.mk
src/commands/cmd_kill.cpp
src/configreader.cpp
src/modules/m_spanningtree/fjoin.cpp
src/modules/m_spanningtree/postcommand.cpp

index 9fd0adfd34d1e17e43c3bd379d3eb3c954d5bb54..7099cefe262a6a7c4b53e4c7ca6dfa6696c1a9fb 100644 (file)
           # hidekills: If defined, replaces who set a /kill with a custom string.
           hidekills=""
 
+          # hideulinekills: Hide kills from clients of ulined servers from server notices.
+          hideulinekills="yes"
+
           # hidesplits: If enabled, non-opers will not be able to see which
           # servers split in a netsplit, they will only be able to see that one
           # occurred (If their client has netsplit detection).
index b01a979a7c2703384bb17155e52688370af0d3df..4a697d05c314a1edbe5de12ec9240978f2cb3b43 100644 (file)
@@ -438,6 +438,10 @@ class CoreExport ServerConfig
         */
        std::string HideKillsServer;
 
+       /** Set to hide kills from clients of ulined servers in snotices.
+        */
+       bool HideULineKills;
+
        /** The full pathname and filename of the PID
         * file as defined in the configuration.
         */
index fa2375ac139ba3ed34b3997e8b74cefbb4abc132..c044bdaaac6a2713d12aaabb6e99132979703046 100644 (file)
@@ -124,8 +124,8 @@ CXXFLAGS += -Iinclude
 @ELSE
   @GNU_ONLY MAKEFLAGS += --silent
   @BSD_ONLY MAKE += -s
-  RUNCC = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
-  RUNLD = perl $(SOURCEPATH)/make/run-cc.pl $(CC)
+  RUNCC = perl "$(SOURCEPATH)/make/run-cc.pl" $(CC)
+  RUNLD = perl "$(SOURCEPATH)/make/run-cc.pl" $(CC)
   VERBOSE =
 @ENDIF
 
@@ -160,7 +160,7 @@ all: $(FOOTER)
 
 target: $(HEADER)
        $(MAKEENV) perl make/calcdep.pl
-       cd $(BUILDPATH); $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
+       cd "$(BUILDPATH)"; $(MAKEENV) $(MAKE) -f real.mk $(TARGET)
 
 debug:
        @${MAKE} D=1 all
@@ -220,22 +220,22 @@ install: target
                echo ""; \
                exit 1; \
        fi
-       @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) $(BASE)
-       @-$(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
-       @-$(INSTALL) -d -m $(INSTMODE_DIR) $(MODPATH)
-       [ $(BUILDPATH)/bin/ -ef $(BINPATH) ] || $(INSTALL) -m $(INSTMODE_BIN) $(BUILDPATH)/bin/inspircd $(BINPATH)
+       @-$(INSTALL) -d -o $(INSTUID) -m $(INSTMODE_DIR) "$(BASE)"
+       @-$(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"
+       @-$(INSTALL) -d -m $(INSTMODE_DIR) "$(MODPATH)"
+       [ "$(BUILDPATH)/bin/" -ef "$(BINPATH)" ] || $(INSTALL) -m $(INSTMODE_BIN) "$(BUILDPATH)/bin/inspircd" "$(BINPATH)"
 @IFNDEF PURE_STATIC
-       [ $(BUILDPATH)/modules/ -ef $(MODPATH) ] || $(INSTALL) -m $(INSTMODE_LIB) $(BUILDPATH)/modules/*.so $(MODPATH)
+       [ "$(BUILDPATH)/modules/" -ef "$(MODPATH)" ] || $(INSTALL) -m $(INSTMODE_LIB) "$(BUILDPATH)/modules/"*.so "$(MODPATH)"
 @ENDIF
-       -$(INSTALL) -m $(INSTMODE_BIN) @STARTSCRIPT@ $(BASE) 2>/dev/null
-       -$(INSTALL) -m $(INSTMODE_LIB) tools/gdbargs $(BASE)/.gdbargs 2>/dev/null
-       -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example $(CONPATH)/examples
-       -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example $(CONPATH)/examples/aliases
-       -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example $(CONPATH)/examples/modules
+       -$(INSTALL) -m $(INSTMODE_BIN) @STARTSCRIPT@ "$(BASE)" 2>/dev/null
+       -$(INSTALL) -m $(INSTMODE_LIB) tools/gdbargs "$(BASE)/.gdbargs" 2>/dev/null
+       -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/*.example "$(CONPATH)/examples"
+       -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/aliases/*.example "$(CONPATH)/examples/aliases"
+       -$(INSTALL) -m $(INSTMODE_LIB) docs/conf/modules/*.example "$(CONPATH)/examples/modules"
        @echo ""
        @echo "*************************************"
        @echo "*        INSTALL COMPLETE!          *"
@@ -258,18 +258,18 @@ GNUmakefile BSDmakefile: make/template/main.mk configure $(RCS_FILES)
 
 clean:
        @echo Cleaning...
-       -rm -f $(BUILDPATH)/bin/inspircd $(BUILDPATH)/include $(BUILDPATH)/real.mk
-       -rm -rf $(BUILDPATH)/obj $(BUILDPATH)/modules
-       @-rmdir $(BUILDPATH)/bin 2>/dev/null
-       @-rmdir $(BUILDPATH) 2>/dev/null
+       -rm -f "$(BUILDPATH)/bin/inspircd" "$(BUILDPATH)/include" "$(BUILDPATH)/real.mk"
+       -rm -rf "$(BUILDPATH)/obj" "$(BUILDPATH)/modules"
+       @-rmdir "$(BUILDPATH)/bin" 2>/dev/null
+       @-rmdir "$(BUILDPATH)" 2>/dev/null
        @echo Completed.
 
 deinstall:
-       -rm -f $(BINPATH)/inspircd
-       -rm -rf $(CONPATH)/examples
-       -rm -f $(MODPATH)/*.so
-       -rm -f $(BASE)/.gdbargs
-       -rm -f $(BASE)/org.inspircd.plist
+       -rm -f "$(BINPATH)/inspircd"
+       -rm -rf "$(CONPATH)/examples"
+       -rm -f "$(MODPATH)/*.so"
+       -rm -f "$(BASE)/.gdbargs"
+       -rm -f "$(BASE)/org.inspircd.plist"
 
 squeakyclean: distclean
 
@@ -283,8 +283,8 @@ configureclean:
        -rm -f org.inspircd.plist
 
 distclean: clean configureclean
-       -rm -rf $(SOURCEPATH)/run
-       find $(SOURCEPATH)/src/modules -type l | xargs rm -f
+       -rm -rf "$(SOURCEPATH)/run"
+       find "$(SOURCEPATH)/src/modules" -type l | xargs rm -f
 
 help:
        @echo 'InspIRCd Makefile'
index 99ac39d42e4f2126f886db9c72d5645f156f6c15..7bdf32c74f8c92d9e95fd13fa049429379cb63af 100644 (file)
@@ -111,7 +111,8 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
                if (!IS_LOCAL(u))
                {
                        // remote kill
-                       ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str());
+                       if (!ServerInstance->Config->HideULineKills || !ServerInstance->ULine(user->server))
+                               ServerInstance->SNO->WriteToSnoMask('K', "Remote kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str());
                        FOREACH_MOD(I_OnRemoteKill, OnRemoteKill(user, u, killreason, killreason));
                }
                else
@@ -121,10 +122,13 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
                         * XXX - this isn't entirely correct, servers A - B - C, oper on A, client on C. Oper kills client, A and B will get remote kill
                         * snotices, C will get a local kill snotice. this isn't accurate, and needs fixing at some stage. -- w00t
                         */
-                       if (IS_LOCAL(user))
-                               ServerInstance->SNO->WriteGlobalSno('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str());
-                       else
-                               ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str());
+                       if (!ServerInstance->Config->HideULineKills || !ServerInstance->ULine(user->server))
+                       {
+                               if (IS_LOCAL(user))
+                                       ServerInstance->SNO->WriteGlobalSno('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str());
+                               else
+                                       ServerInstance->SNO->WriteToSnoMask('k',"Local Kill by %s: %s (%s)", user->nick.c_str(), u->GetFullRealHost().c_str(), parameters[1].c_str());
+                       }
                        ServerInstance->Logs->Log("KILL",DEFAULT,"LOCAL KILL: %s :%s!%s!%s (%s)", u->nick.c_str(), ServerInstance->Config->ServerName.c_str(), user->dhost.c_str(), user->nick.c_str(), parameters[1].c_str());
                        /* Bug #419, make sure this message can only occur once even in the case of multiple KILL messages crossing the network, and change to show
                         * hidekillsserver as source if possible
index bcee938d55208e1aefc3dcc5d0db93cf81820175..5b298ddd8066b6ae00e2ac7f3fd124504ea3fede 100644 (file)
@@ -531,6 +531,7 @@ void ServerConfig::Fill()
        HideBans = security->getBool("hidebans");
        HideWhoisServer = security->getString("hidewhois");
        HideKillsServer = security->getString("hidekills");
+       HideULineKills = security->getBool("hideulinekills");
        RestrictBannedUsers = security->getBool("restrictbannedusers", true);
        GenericOper = security->getBool("genericoper");
        NoUserDns = ConfValue("performance")->getBool("nouserdns");
index 47b39452268dfa8cc34923a98cfc36184726bb25..4ec6e1dbb0f3d502209775cbde367ce325455ba3 100644 (file)
@@ -201,7 +201,7 @@ CmdResult CommandFJoin::Handle(const std::vector<std::string>& params, User *src
                        }
                        else
                        {
-                               ServerInstance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistant user %s in fjoin to %s (probably quit?)", usr, channel.c_str());
+                               ServerInstance->Logs->Log("m_spanningtree",SPARSE, "Ignored nonexistent user %s in fjoin to %s (probably quit?)", usr, channel.c_str());
                                continue;
                        }
                }
index 471bbfcb970670c895ec304df5e30bcef15c44d2..3f5d427e169a7ca90b68e82ae0648217f191c825 100644 (file)
@@ -73,7 +73,7 @@ void SpanningTreeUtilities::RouteCommand(TreeServer* origin, const std::string &
                TreeServer* sdest = FindServer(routing.serverdest);
                if (!sdest)
                {
-                       ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Trying to route ENCAP to nonexistant server %s",
+                       ServerInstance->Logs->Log("m_spanningtree",DEFAULT,"Trying to route ENCAP to nonexistent server %s",
                                routing.serverdest.c_str());
                        return;
                }