bugfixes and some polishing
authorNurPech <nurpech@nurpech.de>
Mon, 7 Jan 2013 19:06:39 +0000 (20:06 +0100)
committerNurPech <nurpech@nurpech.de>
Mon, 7 Jan 2013 19:06:39 +0000 (20:06 +0100)
src/mod-hostserv.c

index a2e50d30aa8ee1c860ae8d0d9b2215198a8361d5..82e9058b6112ae73365575cb0cb10b515044d5db 100644 (file)
@@ -766,8 +766,8 @@ static MODCMD_FUNC(cmd_addhost) {
             reply("HSMSG_FAKEHOST_TOPLEVEL_ALREADY_EXISTS", slfh_name, tlfh_name);
             return 0;
         }
-        if(irccasecmp(tlfh_name, "*")) {
-                   reply("HSMSG_ACCESS_DENIED");
+        if(!irccasecmp(tlfh_name, "*")) {
+                   reply("HSMSG_TOPLEVEL_INVALID", tlfh_name);
                    return 0;   
         }
         hs_add_toplevel(tlfh_name);
@@ -907,7 +907,7 @@ static MODCMD_FUNC(cmd_renamehost) {
             reply("HSMSG_FAKEHOST_TOPLEVEL_ALREADY_EXISTS", new_slfh_name, new_tlfh_name);
             return 0;
         }
-               if(irccasecmp(new_tlfh_name, "*")) {
+               if(!irccasecmp(new_tlfh_name, "*")) {
                    reply("HSMSG_ACCESS_DENIED");
                    return 0;   
         }
@@ -932,6 +932,7 @@ static MODCMD_FUNC(cmd_renamehost) {
             new_tlfh_name--;
             *new_tlfh_name = '.';
             reply("HSMSG_TOPLEVEL_INVALID", new_slfh_name);
+                       return 0;
         }
         struct hs_secondlevel *cslfh;
         for(cslfh = tlfh->secondlevel; cslfh; cslfh = cslfh->next) {