From d21903e901e8b95bc7bbe7c35b0d85385de24d2a Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Fri, 6 Mar 2009 06:37:07 -0500 Subject: [PATCH] Allow "edittrust" to accept 0 as a maximum count, and document it. 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 | 2 +- src/opserv.help | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/opserv.c b/src/opserv.c index 43cbb73..25a48da 100644 --- a/src/opserv.c +++ b/src/opserv.c @@ -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; } diff --git a/src/opserv.help b/src/opserv.help index b9aa128..2f0a590 100644 --- a/src/opserv.help +++ b/src/opserv.help @@ -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 ", "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", @@ -46,7 +47,11 @@ "$uSee Also:$u addalert, stats"); "DELTRUST" ("/msg $O DELTRUST ", "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 ", + "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."); -- 2.20.1