[srvx-commits] CVS: services/src opserv.c,1.299,1.300
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2003-01-01 23:09:00
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv15690/src
Modified Files:
opserv.c
Log Message:
cmd_join(): check that argv[1] actually is a channel name
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.299
retrieving revision 1.300
diff -C2 -r1.299 -r1.300
*** opserv.c 18 Dec 2002 04:45:21 -0000 1.299
--- opserv.c 1 Jan 2003 23:08:53 -0000 1.300
***************
*** 944,959 ****
{
int announce_op = 1;
- (void)argc;
if (!channel) {
announce_op = 0;
if (argc < 2) {
! opserv_notice(user, MSG_MISSING_PARAMS, argv[0]);
OPSERV_SYNTAX();
return 0;
}
channel = AddChannel(argv[1], now, NULL, NULL);
}
if (GetUserMode(channel, opserv)) {
! opserv_notice(user, OSMSG_ALREADY_JOINED, channel->name);
return 0;
}
--- 944,962 ----
{
int announce_op = 1;
if (!channel) {
announce_op = 0;
if (argc < 2) {
! reply(MSG_MISSING_PARAMS, argv[0]);
OPSERV_SYNTAX();
return 0;
}
+ if (!IsChannelName(argv[1])) {
+ reply(MSG_NOT_CHANNEL_NAME, argv[1]);
+ return 0;
+ }
channel = AddChannel(argv[1], now, NULL, NULL);
}
if (GetUserMode(channel, opserv)) {
! reply(OSMSG_ALREADY_JOINED, channel->name);
return 0;
}
***************
*** 961,965 ****
AddChannelOp(1, &opserv, channel, opserv, announce_op);
irc_fetchtopic(opserv, channel->name);
! opserv_notice(user, OSMSG_JOIN_DONE, channel->name);
return 1;
}
--- 964,968 ----
AddChannelOp(1, &opserv, channel, opserv, announce_op);
irc_fetchtopic(opserv, channel->name);
! reply(OSMSG_JOIN_DONE, channel->name);
return 1;
}
|