Allow "edittrust" to accept 0 as a maximum count, and document it.
authorMichael Poole <mdpoole@troilus.org>
Fri, 6 Mar 2009 11:37:07 +0000 (06:37 -0500)
committerMichael Poole <mdpoole@troilus.org>
Fri, 6 Mar 2009 11:37:07 +0000 (06:37 -0500)
Inconsistency between "addtrust" and "edittrust" reported by ZeRoFiGhter.

src/opserv.c (cmd_edittrust): Only check that argv[2] is fully parsed as
    a number; do not require it to be non-zero.
src/opserv.help: Add entry for "edittrust" and reference it appropriately.

src/opserv.c
src/opserv.help

index 43cbb73adbeb604e410df0de26137698ffeb0b15..25a48daa0966f67558db0ca70fc0f30a1920c24e 100644 (file)
@@ -2264,7 +2264,7 @@ static MODCMD_FUNC(cmd_edittrust)
         return 0;
     }
     count = strtoul(argv[2], &tmp, 10);
-    if (!count || *tmp) {
+    if (*tmp != '\0') {
         reply("OSMSG_BAD_NUMBER", argv[2]);
         return 0;
     }
index b9aa12805e5290f16cb490abc92376ffed13df44..2f0a59073ae76b647a200b8284b4763c94bc33c2 100644 (file)
@@ -23,6 +23,7 @@
         "  ADDTRUST [${level/addtrust}]",
         "  DELALERT [${level/delalert}]",
         "  DELTRUST [${level/deltrust}]",
+        "  EDITTRUST [${level/edittrust}]",
         "  INVITEME [${level/inviteme}]",
         "  TRACE    [${level/trace}]",
         "  WHOIS    [${level/whois}]");
@@ -34,7 +35,7 @@
 "ADDTRUST" ("/msg $O ADDTRUST <ip> <count> <duration> <reason>",
         "Allows the specified IP address to have the specified amount of clones before being removed (rather than the usual limit).",
         "You may use 0 as the duration if you do not wish the trust to ever expire, and 0 as the count for unlimited connections.",
-        "$uSee Also:$u deltrust, stats trusted");
+        "$uSee Also:$u deltrust, edittrust, stats trusted");
 "ALERT REACTION" ("$bALERT REACTION$b",
         "Valid alert actions (to be taken when an alert is hit) are:",
         "$bNOTICE$b:       Send a notice to the $b$O$b alert channel",
         "$uSee Also:$u addalert, stats");
 "DELTRUST" ("/msg $O DELTRUST <ip>",
         "Deletes a trusted IP from $b$O's$b trusted hosts list. A trusted IP address is exempted from normal client limits. A list of currently trusted IPs is displayed by $bstats trusted$b.",
-        "$uSee Also:$u addtrust, stats");
+        "$uSee Also:$u addtrust, edittrust, stats");
+"EDITTRUST" ("/msg $O EDITTRUST <ip> <count> <duration> <reason>",
+        "Edits the 'trust' for the specified IP, changing the count, duration and/or reason.",
+        "You may use 0 as the duration if you do not wish the trust to ever expire, and 0 as the count for unlimited connections.",
+        "$uSee Also:$u addtrust, deltrust, stats trusted");
 "INVITEME" ("/msg $O INVITEME [nick]",
         "Invites the specified user (if omitted, you) to $O's debug channel.",
         "This is currently pointless, since no output is sent to the debug channel.");