Require confirmation cookie for giveownership.
authorMichael Poole <mdpoole@troilus.org>
Mon, 7 Aug 2006 03:11:10 +0000 (03:11 +0000)
committerMichael Poole <mdpoole@troilus.org>
Mon, 7 Aug 2006 03:11:10 +0000 (03:11 +0000)
src/chanserv.c (CSMSG_CONFIRM_GIVEOWNERSHIP): New translation string.
  (cmd_giveownership): Fail for non-force unconfirmed giveownerships.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-23

ChangeLog
src/chanserv.c

index 9d9f54e86d3fc2032ceadfefb91b0d31dfed04ee..5f25c6721e21a791c49f0ea1595a73e4273993e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
 #
 
+2006-08-07 03:11:10 GMT        Michael Poole <mdpoole@troilus.org>     patch-23
+
+    Summary:
+      Require confirmation cookie for giveownership.
+    Revision:
+      srvx--devo--1.3--patch-23
+
+    src/chanserv.c (CSMSG_CONFIRM_GIVEOWNERSHIP): New translation string.
+      (cmd_giveownership): Fail for non-force unconfirmed giveownerships.
+
+    modified files:
+     ChangeLog src/chanserv.c
+
+
 2006-07-29 01:36:39 GMT        Michael Poole <mdpoole@troilus.org>     patch-22
 
     Summary:
index cdee6db14d9d301e763672c6e075ad4b55b51a95..93acc3729dd3d8c408636aa50fa44660da9de79e 100644 (file)
@@ -197,6 +197,7 @@ static const struct message_entry msgtab[] = {
     { "CSMSG_MULTIPLE_OWNERS", "There is more than one owner in %s; please use $bCLVL$b, $bDELOWNER$b and/or $bADDOWNER$b instead." },
     { "CSMSG_TRANSFER_WAIT", "You must wait %s before you can give ownership of $b%s$b to someone else." },
     { "CSMSG_NO_TRANSFER_SELF", "You cannot give ownership to your own account." },
+    { "CSMSG_CONFIRM_GIVEOWNERSHIP", "To really give ownership to $b%1$s$b, you must use 'giveownership %1$s %2$s'." },
     { "CSMSG_OWNERSHIP_GIVEN", "Ownership of $b%s$b has been transferred to account $b%s$b." },
 
 /* Ban management */
@@ -5499,6 +5500,7 @@ static CHANSERV_FUNC(cmd_giveownership)
     struct userData *new_owner, *curr_user;
     struct chanData *cData = channel->channel_info;
     struct do_not_register *dnr;
+    const char *confirm;
     unsigned int force;
     unsigned short co_access;
     char reason[MAXLEN];
@@ -5563,6 +5565,12 @@ static CHANSERV_FUNC(cmd_giveownership)
             chanserv_show_dnrs(user, cmd, NULL, new_owner_hi->handle);
         return 0;
     }
+    confirm = make_confirmation_string(curr_user);
+    if(!force && ((argc < 3) || strcmp(argv[2], confirm)))
+    {
+        reply("CSMSG_CONFIRM_GIVEOWNERSHIP", new_owner_hi->handle, confirm);
+        return 0;
+    }
     if(new_owner->access >= UL_COOWNER)
         co_access = new_owner->access;
     else