"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/m_services.c" between
bahamut-2.1.4.tar.gz and bahamut-2.1.5.tar.gz

About: Bahamut is an Internet Relay Chat Daemon (IRCd) designed for DALnet, one of the major IRC networks in the world.

m_services.c  (bahamut-2.1.4):m_services.c  (bahamut-2.1.5)
skipping to change at line 48 skipping to change at line 48
extern int check_channelname(aClient *, unsigned char *); /* for m_aj */ extern int check_channelname(aClient *, unsigned char *); /* for m_aj */
extern aChannel *get_channel(aClient *, char *, int, int *); /* for m_aj */ extern aChannel *get_channel(aClient *, char *, int, int *); /* for m_aj */
extern Link *find_channel_link(Link *, aChannel *); /* for m_aj */ extern Link *find_channel_link(Link *, aChannel *); /* for m_aj */
extern void add_user_to_channel(aChannel *, aClient *, int); /* for m_aj */ extern void add_user_to_channel(aChannel *, aClient *, int); /* for m_aj */
extern void read_motd(char *); /* defined in s_serv.c */ extern void read_motd(char *); /* defined in s_serv.c */
extern void read_shortmotd(char *); /* defined in s_serv.c */ extern void read_shortmotd(char *); /* defined in s_serv.c */
int svspanic = 0; /* Services panic */ int svspanic = 0; /* Services panic */
int svsnoop = 0; /* Services disabled all o:lines (off by default) */ int svsnoop = 0; /* Services disabled all o:lines (off by default) */
int uhm_type = 0; /* User host-masking type (off by default) */ int uhm_type = 0; /* User host-masking type (off by default) */
int uhm_umodeh = 0; /* Let users set umode +H (off by default) */
int services_jr = 0; /* Redirect join requests to services (disabled by default) */ int services_jr = 0; /* Redirect join requests to services (disabled by default) */
/* /*
* the services aliases. * * the services aliases. *
* *
* NICKSERV - /nickserv * CHANSERV - /chanserv * OPERSERV - * NICKSERV - /nickserv * CHANSERV - /chanserv * OPERSERV -
* /operserv * MEMOSERV - /memoserv * SERVICES - /services * * /operserv * MEMOSERV - /memoserv * SERVICES - /services *
* IDENTIFY - /identify * taz's code -mjs * IDENTIFY - /identify * taz's code -mjs
*/ */
skipping to change at line 796 skipping to change at line 797
/* Pass it to all the other servers */ /* Pass it to all the other servers */
sendto_serv_butone(cptr, ":%s SVSTAG %s %s %s %s :%s", parv[0], parv[1], par v[2], parv[3], parv[4], parv[5]); sendto_serv_butone(cptr, ":%s SVSTAG %s %s %s %s :%s", parv[0], parv[1], par v[2], parv[3], parv[4], parv[5]);
return 0; return 0;
} }
/* m_svsuhm /* m_svsuhm
* Define the running user host-masking type * Define the running user host-masking type
* parv[0] - sender * parv[0] - sender
* parv[1] - host-masking type (number) * parv[1] - host-masking type (number)
* parv[2] - optional umode +H status (0=disabled,1=enabled with auto +H on conn ect,2=enabled with no auto +H)
*/ */
int m_svsuhm(aClient *cptr, aClient *sptr, int parc, char *parv[]) int m_svsuhm(aClient *cptr, aClient *sptr, int parc, char *parv[])
{ {
if(!IsServer(sptr) || parc < 2) if(!IsServer(sptr) || parc < 2)
return 0; return 0;
if(!IsULine(sptr)) if(!IsULine(sptr))
{ {
if(aliastab[AII_OS].client && aliastab[AII_OS].client->from!=cptr->from) if(aliastab[AII_OS].client && aliastab[AII_OS].client->from!=cptr->from)
return 0; /* Wrong direction (from a non-u:lined server) */ return 0; /* Wrong direction (from a non-u:lined server) */
} }
uhm_type = atoi(parv[1]); uhm_type = atoi(parv[1]);
sendto_serv_butone(cptr, ":%s SVSUHM %s", sptr->name, parv[1]); if(parc > 2)
{
uhm_umodeh = atoi(parv[2]);
sendto_serv_butone(cptr, ":%s SVSUHM %s %s", sptr->name, parv[1], parv[2
]);
}
else sendto_serv_butone(cptr, ":%s SVSUHM %s", sptr->name, parv[1]);
return 0; return 0;
} }
struct FlagList xflags_list[] = struct FlagList xflags_list[] =
{ {
{ "NO_NOTICE", XFLAG_NO_NOTICE }, { "NO_NOTICE", XFLAG_NO_NOTICE },
{ "NO_CTCP", XFLAG_NO_CTCP }, { "NO_CTCP", XFLAG_NO_CTCP },
{ "NO_PART_MSG", XFLAG_NO_PART_MSG }, { "NO_PART_MSG", XFLAG_NO_PART_MSG },
{ "NO_QUIT_MSG", XFLAG_NO_QUIT_MSG }, { "NO_QUIT_MSG", XFLAG_NO_QUIT_MSG },
{ "EXEMPT_OPPED", XFLAG_EXEMPT_OPPED }, { "EXEMPT_OPPED", XFLAG_EXEMPT_OPPED },
{ "EXEMPT_VOICED", XFLAG_EXEMPT_VOICED }, { "EXEMPT_VOICED", XFLAG_EXEMPT_VOICED },
{ "EXEMPT_IDENTD", XFLAG_EXEMPT_IDENTD }, { "EXEMPT_IDENTD", XFLAG_EXEMPT_IDENTD },
{ "EXEMPT_REGISTERED", XFLAG_EXEMPT_REGISTERED }, { "EXEMPT_REGISTERED", XFLAG_EXEMPT_REGISTERED },
{ "EXEMPT_INVITES", XFLAG_EXEMPT_INVITES }, { "EXEMPT_INVITES", XFLAG_EXEMPT_INVITES },
{ "EXEMPT_WEBIRC", XFLAG_EXEMPT_WEBIRC },
{ "HIDE_MODE_LISTS", XFLAG_HIDE_MODE_LISTS }, { "HIDE_MODE_LISTS", XFLAG_HIDE_MODE_LISTS },
{ "NO_NICK_CHANGE", XFLAG_NO_NICK_CHANGE }, { "NO_NICK_CHANGE", XFLAG_NO_NICK_CHANGE },
{ "NO_UTF8", XFLAG_NO_UTF8 }, { "NO_UTF8", XFLAG_NO_UTF8 },
{ "SJR", XFLAG_SJR }, { "SJR", XFLAG_SJR },
{ "USER_VERBOSE", XFLAG_USER_VERBOSE }, { "USER_VERBOSE", XFLAG_USER_VERBOSE },
{ "USER_VERBOSEV2", XFLAG_USER_VERBOSE }, { "USER_VERBOSEV2", XFLAG_USER_VERBOSE },
{ "OPER_VERBOSE", XFLAG_OPER_VERBOSE }, { "OPER_VERBOSE", XFLAG_OPER_VERBOSE },
{ "OPER_VERBOSEV2", XFLAG_OPER_VERBOSE }, { "OPER_VERBOSEV2", XFLAG_OPER_VERBOSE },
{ NULL, 0 } { NULL, 0 }
}; };
skipping to change at line 852 skipping to change at line 860
* parv[3] - optional setting:value * parv[3] - optional setting:value
* ... * ...
* parv[parc-1] - optional setting:value * parv[parc-1] - optional setting:value
* *
* Settings: * Settings:
* JOIN_CONNECT_TIME - Number of seconds the user must be online to be able to join * JOIN_CONNECT_TIME - Number of seconds the user must be online to be able to join
* TALK_CONNECT_TIME - Number of seconds the user must be online to be able to talk on the channel * TALK_CONNECT_TIME - Number of seconds the user must be online to be able to talk on the channel
* TALK_JOIN_TIME - Number of seconds the user must be on the channel to be able to tlak on the channel * TALK_JOIN_TIME - Number of seconds the user must be on the channel to be able to tlak on the channel
* MAX_BANS - Will let us increase the ban limit for specific channel s * MAX_BANS - Will let us increase the ban limit for specific channel s
* MAX_INVITES - Will let us increase the invite limit for specific chan nels * MAX_INVITES - Will let us increase the invite limit for specific chan nels
* MAX_MSG_TIME - Maximum number of messages that can be sent in x second s, msgs:time
* *
* 1/0 (on/off) options: * 1/0 (on/off) options:
* NO_NOTICE - no notices can be sent to the channel (on/off) * NO_NOTICE - no notices can be sent to the channel (on/off)
* NO_CTCP - no ctcps can be sent to the channel (on/off) * NO_CTCP - no ctcps can be sent to the channel (on/off)
* NO_PART_MSG - no /part messages (on/off) * NO_PART_MSG - no /part messages (on/off)
* NO_QUIT_MSG - no /quit messages (on/off) * NO_QUIT_MSG - no /quit messages (on/off)
* HIDE_MODE_LISTS - hide /mode #channel +b/+I/+e lists from non-ops (on/off ) * HIDE_MODE_LISTS - hide /mode #channel +b/+I/+e lists from non-ops (on/off )
* SJR - enable services join request for this channel (must als o be enabled globally) * SJR - enable services join request for this channel (must als o be enabled globally)
* NO_NICK_CHANGE - no nick changes allowed on this channel (on/off) * NO_NICK_CHANGE - no nick changes allowed on this channel (on/off)
* EXEMPT_OPPED - exempt opped users (on/off) * EXEMPT_OPPED - exempt opped users (on/off)
* EXEMPT_VOICED - exempt voiced users (on/off) * EXEMPT_VOICED - exempt voiced users (on/off)
* EXEMPT_IDENTD - exempt users with identd (on/off) * EXEMPT_IDENTD - exempt users with identd (on/off)
* EXEMPT_REGISTERED - exempt users with umode +r (on/off) * EXEMPT_REGISTERED - exempt users with umode +r (on/off)
* EXEMPT_INVITES - exempt users who are +I'ed (on/off) * EXEMPT_INVITES - exempt users who are +I'ed (on/off)
* EXEMPT_WEBIRC - exempt webirc users (on/off)
* USER_VERBOSE - send failed command messages to #channel-relay (on/off) * USER_VERBOSE - send failed command messages to #channel-relay (on/off)
* OPER_VERBOSE - send failed command messages to +f opers (on/off) * OPER_VERBOSE - send failed command messages to +f opers (on/off)
* *
* Special option: * Special option:
* GREETMSG - A message that will be sent when a user joins the channel * GREETMSG - A message that will be sent when a user joins the channel
*/ */
int m_svsxcf(aClient *cptr, aClient *sptr, int parc, char *parv[]) int m_svsxcf(aClient *cptr, aClient *sptr, int parc, char *parv[])
{ {
aChannel *chptr; aChannel *chptr;
char *opt, *value; char *opt, *value;
skipping to change at line 917 skipping to change at line 927
i = 2; i = 2;
if(parc<3 || !strcasecmp(parv[2],"DEFAULT")) if(parc<3 || !strcasecmp(parv[2],"DEFAULT"))
{ {
/* Reset all the extended channel flags back to their defaults... */ /* Reset all the extended channel flags back to their defaults... */
chptr->join_connect_time = 0; chptr->join_connect_time = 0;
chptr->talk_connect_time = 0; chptr->talk_connect_time = 0;
chptr->talk_join_time = 0; chptr->talk_join_time = 0;
chptr->max_bans = MAXBANS; chptr->max_bans = MAXBANS;
chptr->max_invites = MAXINVITELIST; chptr->max_invites = MAXINVITELIST;
chptr->max_messages = 0;
chptr->max_messages_time = 0;
chptr->xflags = 0; chptr->xflags = 0;
if(chptr->greetmsg) if(chptr->greetmsg)
MyFree(chptr->greetmsg); MyFree(chptr->greetmsg);
i++; i++;
} }
for(; i<parc; i++) for(; i<parc; i++)
{ {
opt = parv[i]; opt = parv[i];
if((value = strchr(parv[i],':'))) if((value = strchr(parv[i],':')))
{ {
*value = '\0'; *value = '\0';
value++; value++;
if(!*value) continue; /* Just in case someone does something like op tion: with no value */ if(!*value) continue; /* Just in case someone does something like op tion: with no value */
if(!parv[i][0]) continue; /* Just in case someone does something lik e :value with no option */ if(!parv[i][0]) continue; /* Just in case someone does something lik e :value with no option */
if(!strcasecmp(opt,"JOIN_CONNECT_TIME")) { chptr->join_connect_time = atoi(value); chptr->xflags |= XFLAG_SET; } if(!strcasecmp(opt,"JOIN_CONNECT_TIME")) { chptr->join_connect_time = atoi(value); chptr->xflags |= XFLAG_SET; }
else if(!strcasecmp(opt,"TALK_CONNECT_TIME")) { chptr->talk_connect_ time = atoi(value); chptr->xflags |= XFLAG_SET; } else if(!strcasecmp(opt,"TALK_CONNECT_TIME")) { chptr->talk_connect_ time = atoi(value); chptr->xflags |= XFLAG_SET; }
else if(!strcasecmp(opt,"TALK_JOIN_TIME")) { chptr->talk_join_time = atoi(value); chptr->xflags |= XFLAG_SET; } else if(!strcasecmp(opt,"TALK_JOIN_TIME")) { chptr->talk_join_time = atoi(value); chptr->xflags |= XFLAG_SET; }
else if(!strcasecmp(opt,"MAX_BANS")) { chptr->max_bans = atoi(value) ; chptr->xflags |= XFLAG_SET; } else if(!strcasecmp(opt,"MAX_BANS")) { chptr->max_bans = atoi(value) ; chptr->xflags |= XFLAG_SET; }
else if(!strcasecmp(opt,"MAX_INVITES")) { chptr->max_invites = atoi( value); chptr->xflags |= XFLAG_SET; } else if(!strcasecmp(opt,"MAX_INVITES")) { chptr->max_invites = atoi( value); chptr->xflags |= XFLAG_SET; }
else if(!strcasecmp(opt,"MAX_MSG_TIME"))
{
char *mmt_value;
mmt_value = opt;
if ((mmt_value = strchr(value, ':')))
{
*mmt_value = '\0';
mmt_value++;
chptr->max_messages = atoi(value);
chptr->max_messages_time = atoi(mmt_value);
chptr->xflags |= XFLAG_SET;
}
}
else else
{ {
for(xflag = xflags_list; xflag->option; xflag++) for(xflag = xflags_list; xflag->option; xflag++)
{ {
if(!strcasecmp(opt,xflag->option)) if(!strcasecmp(opt,xflag->option))
{ {
if((atoi(value) == 1) || !strcasecmp(value,"on")) if((atoi(value) == 1) || !strcasecmp(value,"on"))
{ {
chptr->xflags |= xflag->flag; chptr->xflags |= xflag->flag;
chptr->xflags |= XFLAG_SET; chptr->xflags |= XFLAG_SET;
skipping to change at line 1000 skipping to change at line 1028
if(!IsULine(sptr)) if(!IsULine(sptr))
return 0; /* Only to be used by u:lined servers */ return 0; /* Only to be used by u:lined servers */
if(parc < 4 || *parv[1] == 0) if(parc < 4 || *parv[1] == 0)
return 0; return 0;
fnick = nick = parv[1]; fnick = nick = parv[1];
nickts = atol(parv[2]); nickts = atol(parv[2]);
while(*nick == '@' || *nick == '+') while(*nick == '@' || *nick == '%' || *nick == '+')
{ {
switch(*nick) switch(*nick)
{ {
case '@': case '@':
flags |= CHFL_CHANOP; flags |= CHFL_CHANOP;
break; break;
#ifdef USE_HALFOPS
case '%':
flags |= CHFL_HALFOP;
break;
#endif
case '+': case '+':
flags |= CHFL_VOICE; flags |= CHFL_VOICE;
break; break;
} }
nick++; nick++;
} }
if(!(acptr = find_client(nick, NULL))) if(!(acptr = find_client(nick, NULL)))
return 0; /* Can't find the target nick */ return 0; /* Can't find the target nick */
if(nickts && acptr->tsinfo != nickts) if(nickts && acptr->tsinfo != nickts)
return 0; /* tsinfo doesn't match */ return 0; /* tsinfo doesn't match */
if(*parv[2] == '0' && !atoi(parv[3])) if(*parv[3] == '0' && !atoi(parv[3]))
{ {
if(acptr->user->channel == NULL) if(acptr->user->channel == NULL)
return 0; /* Target nick isn't on any channels */ return 0; /* Target nick isn't on any channels */
while ((lp = acptr->user->channel)) while ((lp = acptr->user->channel))
{ {
chptr = lp->value.chptr; chptr = lp->value.chptr;
sendto_channel_butserv(chptr, acptr, ":%s PART %s", acptr->name, chp tr->chname); sendto_channel_butserv(chptr, acptr, ":%s PART %s", acptr->name, chp tr->chname);
remove_user_from_channel(acptr, chptr); remove_user_from_channel(acptr, chptr);
} }
} }
skipping to change at line 1071 skipping to change at line 1104
if(chptr->greetmsg) if(chptr->greetmsg)
{ {
sendto_one(sptr, ":%s!%s@%s PRIVMSG %s :%s", Network_Name, N etwork_Name, DEFAULT_STAFF_ADDRESS, chptr->chname, chptr->greetmsg); sendto_one(sptr, ":%s!%s@%s PRIVMSG %s :%s", Network_Name, N etwork_Name, DEFAULT_STAFF_ADDRESS, chptr->chname, chptr->greetmsg);
} }
} }
if(flags) if(flags)
{ {
if(flags & CHFL_CHANOP) if(flags & CHFL_CHANOP)
sendto_channel_butserv(chptr, sptr, ":%s MODE %s +o %s", sptr-> name, sendto_channel_butserv(chptr, sptr, ":%s MODE %s +o %s", sptr-> name,
chptr->chname, acptr->name); chptr->chname, acptr->name);
#ifdef USE_HALFOPS
if(flags & CHFL_HALFOP)
sendto_channel_butserv(chptr, sptr, ":%s MODE %s +h %s", sptr->
name,
chptr->chname, acptr->name);
#endif
if(flags & CHFL_VOICE) if(flags & CHFL_VOICE)
sendto_channel_butserv(chptr, sptr, ":%s MODE %s +v %s", sptr-> name, sendto_channel_butserv(chptr, sptr, ":%s MODE %s +v %s", sptr-> name,
chptr->chname, acptr->name); chptr->chname, acptr->name);
} }
} }
} }
/* Pass it to all the other servers... */ /* Pass it to all the other servers... */
if(parc>4) if(parc>4)
sendto_serv_butone(cptr, ":%s AJ %s %ld %s %ld", sptr->name, fnick, nick ts, chptr->chname, chptr->channelts); sendto_serv_butone(cptr, ":%s AJ %s %ld %s %s", sptr->name, fnick, nickt s, parv[3], parv[4]);
else else
sendto_serv_butone(cptr, ":%s AJ %s %ld %s", sptr->name, fnick, nickts, chptr->chname); sendto_serv_butone(cptr, ":%s AJ %s %ld %s", sptr->name, fnick, nickts, parv[3]);
return 0; return 0;
} }
/* m_sjr - Check the join (request) with services (mostly stolen from bahamut-ir ctoo) /* m_sjr - Check the join (request) with services (mostly stolen from bahamut-ir ctoo)
* -Kobi_S 16/07/2005 * -Kobi_S 16/07/2005
*/ */
int m_sjr(aClient *cptr, aClient *sptr, int parc, char *parv[], AliasInfo *ai) int m_sjr(aClient *cptr, aClient *sptr, int parc, char *parv[], AliasInfo *ai)
{ {
if(MyClient(sptr)) if(MyClient(sptr))
skipping to change at line 1109 skipping to change at line 1147
return 0; /* Check to avoid message loops when admins get stupid */ return 0; /* Check to avoid message loops when admins get stupid */
if(parc<4) if(parc<4)
sendto_one(ai->client->from, ":%s SJR %s %s", sptr->name, parv[1], parv[ 2]); sendto_one(ai->client->from, ":%s SJR %s %s", sptr->name, parv[1], parv[ 2]);
else else
sendto_one(ai->client->from, ":%s SJR %s %s :%s", sptr->name, parv[1], p arv[2], parv[3]); sendto_one(ai->client->from, ":%s SJR %s %s :%s", sptr->name, parv[1], p arv[2], parv[3]);
return 0; return 0;
} }
/* m_svsctrl - Lets services control join requests (will be extended to support
other settings in the future)
* parv[0] - sender
* parv[1] - setting
* parv[2] - value
*/
int m_svsctrl(aClient *cptr, aClient *sptr, int parc, char *parv[])
{
if(!IsULine(sptr) || parc<4)
return 0;
if(parc==4 && (hunt_server(cptr, sptr, ":%s SVSCTRL %s %s :%s", 1, parc, par
v) != HUNTED_ISME))
return 0;
if(parc==5 && (hunt_server(cptr, sptr, ":%s SVSCTRL %s %s %s :%s", 1, parc,
parv) != HUNTED_ISME))
return 0;
if(parc==6 && (hunt_server(cptr, sptr, ":%s SVSCTRL %s %s %s %s :%s", 1, par
c, parv) != HUNTED_ISME))
return 0;
if(parc==7 && (hunt_server(cptr, sptr, ":%s SVSCTRL %s %s %s %s %s :%s", 1,
parc, parv) != HUNTED_ISME))
return 0;
if(parc==8 && (hunt_server(cptr, sptr, ":%s SVSCTRL %s %s %s %s %s %s :%s",
1, parc, parv) != HUNTED_ISME))
return 0;
if(parc==9 && (hunt_server(cptr, sptr, ":%s SVSCTRL %s %s %s %s %s %s %s :%s
", 1, parc, parv) != HUNTED_ISME))
return 0;
if(parc!=4 && parc!=5 && parc!=6 && parc!=7 && parc!=8 && parc!=9) return 0;
/* Just in case... */
if(!mycmp(parv[2], "SJR"))
{
services_jr = atoi(parv[3]);
return 0;
}
return 0;
}
u_long u_long
memcount_m_services(MCm_services *mc) memcount_m_services(MCm_services *mc)
{ {
mc->file = __FILE__; mc->file = __FILE__;
return 0; return 0;
} }
 End of changes. 15 change blocks. 
5 lines changed or deleted 86 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)