+ * do_kill - Performs the generic work involved in killing a client
+ *
+ */
+static int do_kill(struct Client* cptr, struct Client* sptr,
+ struct Client* victim, char* inpath, char* path, char* msg)
+{
+ assert(0 != cptr);
+ assert(0 != sptr);
+ assert(!IsServer(victim));
+
+ /*
+ * Notify all *local* opers about the KILL (this includes the one
+ * originating the kill, if from this server--the special numeric
+ * reply message is not generated anymore).
+ *
+ * Note: "victim->name" is used instead of "user" because we may
+ * have changed the target because of the nickname change.
+ */
+ sendto_opmask_butone(0, IsServer(sptr) ? SNO_SERVKILL : SNO_OPERKILL,
+ "Received KILL message for %s from %s Path: %s!%s %s",
+ get_client_name(victim, SHOW_IP), cli_name(sptr),
+ inpath, path, msg);
+ log_write_kill(victim, sptr, inpath, path, msg);
+
+ /*
+ * And pass on the message to other servers. Note, that if KILL
+ * was changed, the message has to be sent to all links, also
+ * back.
+ * Client suicide kills are NOT passed on --SRB
+ */
+ if (IsServer(cptr) || !MyConnect(victim)) {
+ sendcmdto_serv_butone(sptr, CMD_KILL, cptr, "%C :%s!%s %s", victim,
+ inpath, path, msg);
+
+ /*
+ * Set FLAG_KILLED. This prevents exit_one_client from sending
+ * the unnecessary QUIT for this. (This flag should never be
+ * set in any other place)
+ */
+ SetFlag(victim, FLAG_KILLED);
+ }
+
+ /*
+ * Tell the victim she/he has been zapped, but *only* if
+ * the victim is on current server--no sense in sending the
+ * notification chasing the above kill, it won't get far
+ * anyway (as this user don't exist there any more either)
+ * In accordance with the new hiding rules, the victim
+ * always sees the kill as coming from me.
+ */
+ if (MyConnect(victim))
+ sendcmdto_one(feature_bool(FEAT_HIS_KILLWHO) ? &his : sptr, CMD_KILL,
+ victim, "%C :%s %s", victim, feature_bool(FEAT_HIS_KILLWHO)
+ ? feature_str(FEAT_HIS_SERVERNAME) : cli_name(sptr), msg);
+ return exit_client_msg(cptr, victim, feature_bool(FEAT_HIS_KILLWHO)
+ ? &me : sptr, "Killed (%s %s)",
+ feature_bool(FEAT_HIS_KILLWHO) ?
+ feature_str(FEAT_HIS_SERVERNAME) : cli_name(sptr),
+ msg);
+}
+
+/*
+ * ms_kill - server message handler