CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Branch tags: u2_10_11_03
Commit time: 2002-11-23 05:50:43 UTC
Modified files:
Tag: u2_10_11_03
ChangeLog include/s_user.h ircd/m_join.c ircd/m_nick.c
ircd/s_user.c
Log message:
Author: Isomer <[EMAIL PROTECTED]>
Log message:
Fixed typo
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.290.2.125.2.9 ircu2.10/ChangeLog:1.290.2.125.2.10
--- ircu2.10/ChangeLog:1.290.2.125.2.9 Fri Nov 22 21:04:56 2002
+++ ircu2.10/ChangeLog Fri Nov 22 21:50:33 2002
@@ -1,4 +1,7 @@
2002-11-19 Perry Lorier <[EMAIL PROTECTED]>
+ * ircd/m_join.c: Fix the inevitable typo
+
+2002-11-19 Perry Lorier <[EMAIL PROTECTED]>
* ircd/m_join.c: Make the protocol violation warning more verbose
* ircd/m_channel.c: OUTsiders OVERRIDE overly-noisy join patch.
Index: ircu2.10/include/s_user.h
diff -u ircu2.10/include/s_user.h:1.12.2.2 ircu2.10/include/s_user.h:1.12.2.2.8.1
--- ircu2.10/include/s_user.h:1.12.2.2 Wed Apr 3 07:20:57 2002
+++ ircu2.10/include/s_user.h Fri Nov 22 21:50:33 2002
@@ -1,7 +1,7 @@
/*
* s_user.h
*
- * $Id: s_user.h,v 1.12.2.2 2002/04/03 15:20:57 kev Exp $
+ * $Id: s_user.h,v 1.12.2.2.8.1 2002/11/23 05:50:33 isomer Exp $
*/
#ifndef INCLUDED_s_user_h
#define INCLUDED_s_user_h
@@ -61,7 +61,6 @@
extern void user_count_memory(size_t* count_out, size_t* bytes_out);
-extern int do_nick_name(char* nick);
extern int set_nick_name(struct Client* cptr, struct Client* sptr,
const char* nick, int parc, char* parv[]);
extern void send_umode_out(struct Client* cptr, struct Client* sptr, int old,
Index: ircu2.10/ircd/m_join.c
diff -u ircu2.10/ircd/m_join.c:1.16.2.2.2.1 ircu2.10/ircd/m_join.c:1.16.2.2.2.2
--- ircu2.10/ircd/m_join.c:1.16.2.2.2.1 Fri Nov 22 21:04:57 2002
+++ ircu2.10/ircd/m_join.c Fri Nov 22 21:50:33 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_join.c,v 1.16.2.2.2.1 2002/11/23 05:04:57 isomer Exp $
+ * $Id: m_join.c,v 1.16.2.2.2.2 2002/11/23 05:50:33 isomer Exp $
*/
/*
@@ -310,7 +310,7 @@
return protocol_violation(sptr,
"%s tried to JOIN %s, duh!",
cli_name(sptr),
- (parc < 2 || *parv[1] == '\0') ? "a channel":argv[1]
+ (parc < 2 || *parv[1] == '\0') ? "a channel":parv[1]
);
}
Index: ircu2.10/ircd/m_nick.c
diff -u ircu2.10/ircd/m_nick.c:1.17.2.1 ircu2.10/ircd/m_nick.c:1.17.2.1.8.1
--- ircu2.10/ircd/m_nick.c:1.17.2.1 Wed Jul 17 15:55:40 2002
+++ ircu2.10/ircd/m_nick.c Fri Nov 22 21:50:33 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_nick.c,v 1.17.2.1 2002/07/17 22:55:40 kev Exp $
+ * $Id: m_nick.c,v 1.17.2.1.8.1 2002/11/23 05:50:33 isomer Exp $
*/
/*
@@ -102,6 +102,39 @@
#include <string.h>
/*
+ * 'do_nick_name' ensures that the given parameter (nick) is really a proper
+ * string for a nickname (note, the 'nick' may be modified in the process...)
+ *
+ * RETURNS the length of the final NICKNAME (0, if nickname is invalid)
+ *
+ * Nickname characters are in range 'A'..'}', '_', '-', '0'..'9'
+ * anything outside the above set will terminate nickname.
+ * In addition, the first character cannot be '-' or a Digit.
+ *
+ * Note:
+ * The '~'-character should be allowed, but a change should be global,
+ * some confusion would result if only few servers allowed it...
+ */
+static int do_nick_name(char* nick)
+{
+ char* ch = nick;
+ char* end = ch + NICKLEN;
+ assert(0 != ch);
+
+ if (*ch == '-' || IsDigit(*ch)) /* first character in [0..9-] */
+ return 0;
+
+ for ( ; (ch < end) && *ch; ++ch)
+ if (!IsNickChar(*ch))
+ break;
+
+ *ch = '\0';
+
+ return (ch - nick);
+}
+
+
+/*
* m_nick - message handler for local clients
* parv[0] = sender prefix
* parv[1] = nickname
@@ -140,10 +173,7 @@
strcpy(nick, arg);
/*
- * If do_nick_name() returns a null name OR if the server sent a nick
- * name and do_nick_name() changed it in some way (due to rules of nick
- * creation) then reject it. If from a server and we reject it,
- * and KILL it. -avalon 4/4/92
+ * If do_nick_name() returns a null name then reject it.
*/
if (0 == do_nick_name(nick)) {
send_reply(sptr, ERR_ERRONEUSNICKNAME, arg);
@@ -165,10 +195,12 @@
*/
return set_nick_name(cptr, sptr, nick, parc, parv);
}
+
if (IsServer(acptr)) {
send_reply(sptr, ERR_NICKNAMEINUSE, nick);
return 0; /* NICK message ignored */
}
+
/*
* If acptr == sptr, then we have a client doing a nick
* change between *equivalent* nicknames as far as server
@@ -209,6 +241,7 @@
* "dormant nick" way of generating collisions...
*
* XXX - hmmm can this happen after one is registered?
+ *
*/
if (IsUnknown(acptr) && MyConnect(acptr)) {
++ServerStats->is_ref;
@@ -310,6 +343,8 @@
* constructed). -avalon
*/
+ assert(NULL = strchr(nick,'.'));
+
acptr = FindClient(nick);
if (!acptr) {
/*
@@ -319,31 +354,6 @@
}
assert(0 != acptr);
- if (IsServer(acptr)) { /* shouldn't even happen, actually */
- /*
- * We have a nickname trying to use the same name as
- * a server. Send out a nick collision KILL to remove
- * the nickname. As long as only a KILL is sent out,
- * there is no danger of the server being disconnected.
- * Ultimate way to jupiter a nick ? >;-). -avalon
- */
- sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C(%C <- %C)", sptr,
- cli_from(acptr), cptr);
- ++ServerStats->is_kill;
-
- sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s <- %s)", sptr, cli_name(&me),
- cli_name(cli_from(acptr)), cli_name(cptr));
-
- cli_flags(sptr) |= FLAGS_KILLED;
- /*
- * if sptr is a server it is exited here, nothing else to do
- */
- return exit_client_msg(cptr, sptr, &me,
- "Killed (%s (%s <- %s))",
- feature_str(FEAT_HIS_SERVERNAME),
- cli_name(cli_from(acptr)), cli_name(cptr));
- }
-
/*
* If acptr == sptr, then we have a client doing a nick
* change between *equivalent* nicknames as far as server
@@ -452,11 +462,6 @@
"Killed (%s (Nick collision))",
feature_str(FEAT_HIS_SERVERNAME));
- /*
- * we have killed sptr off, zero out it's pointer so if it's used
- * again we'll know about it --Bleep
- */
- sptr = 0;
}
if (lastnick != cli_lastnick(acptr))
return 0; /* Ignore the NICK */
Index: ircu2.10/ircd/s_user.c
diff -u ircu2.10/ircd/s_user.c:1.52.2.13.2.1 ircu2.10/ircd/s_user.c:1.52.2.13.2.2
--- ircu2.10/ircd/s_user.c:1.52.2.13.2.1 Mon Oct 21 07:11:44 2002
+++ ircu2.10/ircd/s_user.c Fri Nov 22 21:50:33 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: s_user.c,v 1.52.2.13.2.1 2002/10/21 14:11:44 decampos Exp $
+ * $Id: s_user.c,v 1.52.2.13.2.2 2002/11/23 05:50:33 isomer Exp $
*/
#include "config.h"
@@ -286,37 +286,6 @@
return (HUNTED_PASS);
}
-/*
- * 'do_nick_name' ensures that the given parameter (nick) is really a proper
- * string for a nickname (note, the 'nick' may be modified in the process...)
- *
- * RETURNS the length of the final NICKNAME (0, if nickname is invalid)
- *
- * Nickname characters are in range 'A'..'}', '_', '-', '0'..'9'
- * anything outside the above set will terminate nickname.
- * In addition, the first character cannot be '-' or a Digit.
- *
- * Note:
- * The '~'-character should be allowed, but a change should be global,
- * some confusion would result if only few servers allowed it...
- */
-int do_nick_name(char* nick)
-{
- char* ch = nick;
- char* end = ch + NICKLEN;
- assert(0 != ch);
-
- if (*ch == '-' || IsDigit(*ch)) /* first character in [0..9-] */
- return 0;
-
- for ( ; (ch < end) && *ch; ++ch)
- if (!IsNickChar(*ch))
- break;
-
- *ch = '\0';
-
- return (ch - nick);
-}
/*
* clean_user_id
----------------------- End of diff -----------------------