From: Matthew Wiggins Date: Fri, 14 Jan 2005 07:50:01 +0000 (+0000) Subject: made SEND_UMODES sane with SSL (config.h) X-Git-Tag: rubiks-ircd-1-0-6~33 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=528d005a24b58b0abd4009a27e714aec305d55c6;p=rubiks-ircd.git made SEND_UMODES sane with SSL (config.h) fixed channel +S vulnerabilities (channel.c) fixed umode +S vulnerability (s_user.c) --- diff --git a/include/config.h b/include/config.h index 5dbfc32..c215129 100644 --- a/include/config.h +++ b/include/config.h @@ -18,7 +18,7 @@ * */ -/* $Id: config.h,v 1.8 2005/01/14 06:26:00 mmondor Exp $ */ +/* $Id: config.h,v 1.9 2005/01/14 07:50:00 mwiggins Exp $ */ #ifndef __config_include__ #define __config_include__ @@ -123,7 +123,7 @@ * to. If you are connected to the main DALnet network, you MUST have this * enabled. */ -#define HIDEULINEDSERVS 1 +#define HIDEULINEDSERVS 0 #define THROTTLE_ENABLE /* enable throttling, see below */ diff --git a/include/struct.h b/include/struct.h index 76275a3..dd38edc 100644 --- a/include/struct.h +++ b/include/struct.h @@ -20,7 +20,7 @@ * */ -/* $Id: struct.h,v 1.5 2005/01/13 10:35:43 mmondor Exp $ */ +/* $Id: struct.h,v 1.6 2005/01/14 07:50:01 mwiggins Exp $ */ #ifndef __struct_include__ #define __struct_include__ @@ -344,13 +344,18 @@ typedef struct MotdItem aMotd; * that mode will be 'silent.' */ +#ifdef USE_SSL +#define SEND_UMODES (UMODE_a|UMODE_i|UMODE_o|UMODE_r|UMODE_A|UMODE_I|UMODE_R|UMODE_S) +#else #define SEND_UMODES (UMODE_a|UMODE_i|UMODE_o|UMODE_r|UMODE_A|UMODE_I|UMODE_R) -#ifdef DCCALLOW +#endif + +#ifdef USE_SSL #define ALL_UMODES (SEND_UMODES|UMODE_b|UMODE_c|UMODE_d|UMODE_e|UMODE_f|\ UMODE_g|UMODE_h|UMODE_j|UMODE_k|UMODE_m|UMODE_n|UMODE_s|\ - UMODE_w|UMODE_y|UMODE_F|UMODE_K|UMODE_O) + UMODE_w|UMODE_y|UMODE_F|UMODE_K|UMODE_O|UMODE_S) #else -#define ALL_UMODES (SEND_UMODES|UMODE_b|UMODE_c|UMODE_d|UMODE_f|\ +#define ALL_UMODES (SEND_UMODES|UMODE_b|UMODE_c|UMODE_d|UMODE_e|UMODE_f|\ UMODE_g|UMODE_h|UMODE_j|UMODE_k|UMODE_m|UMODE_n|UMODE_s|\ UMODE_w|UMODE_y|UMODE_F|UMODE_K|UMODE_O) #endif @@ -360,15 +365,9 @@ typedef struct MotdItem aMotd; #define USER_UMODES (UMODE_i|UMODE_k|UMODE_w|UMODE_s|UMODE_R) /* modes only opers can have */ -#ifdef DCCALLOW #define OPER_UMODES (UMODE_a|UMODE_b|UMODE_c|UMODE_d|UMODE_e|UMODE_f|UMODE_g|\ UMODE_h|UMODE_j|UMODE_m|UMODE_n|UMODE_y|UMODE_A|UMODE_F|\ UMODE_K) -#else -#define OPER_UMODES (UMODE_a|UMODE_b|UMODE_c|UMODE_d|UMODE_f|UMODE_g|\ - UMODE_h|UMODE_j|UMODE_m|UMODE_n|UMODE_y|UMODE_A|UMODE_F|\ - UMODE_K) -#endif #define FLAGS_ID (FLAGS_DOID|FLAGS_GOTID) diff --git a/src/channel.c b/src/channel.c index 31ea9ef..dca10df 100644 --- a/src/channel.c +++ b/src/channel.c @@ -18,7 +18,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: channel.c,v 1.2 2005/01/13 10:35:43 mmondor Exp $ */ +/* $Id: channel.c,v 1.3 2005/01/14 07:50:01 mwiggins Exp $ */ #include "struct.h" #include "common.h" @@ -970,6 +970,10 @@ int can_send(aClient *cptr, aChannel *chptr, char *msg) return (ERR_NEEDREGGEDNICK); if ((chptr->mode.mode & MODE_NOCOLOR) && msg_has_colors(msg)) return (ERR_NOCOLORSONCHAN); +#ifdef USE_SSL + if ((chptr->mode.mode & MODE_SSL) && !IsSSL(cptr)) + return (MODE_SSL); +#endif if (MyClient(cptr) && is_banned(cptr, chptr, NULL)) return (MODE_BAN); /* * channel is -n and user is not there; @@ -987,6 +991,10 @@ int can_send(aClient *cptr, aChannel *chptr, char *msg) return (MODE_BAN); if ((chptr->mode.mode & MODE_MODREG) && !IsRegNick(cptr)) return (ERR_NEEDREGGEDNICK); +#ifdef USE_SSL + if ((chptr->mode.mode & MODE_SSL) && !IsSSL(cptr)) + return (MODE_SSL); +#endif } if ((chptr->mode.mode & MODE_NOCOLOR) && msg_has_colors(msg)) return (ERR_NOCOLORSONCHAN); diff --git a/src/s_user.c b/src/s_user.c index d2059c0..4f81f55 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -21,7 +21,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: s_user.c,v 1.6 2005/01/14 06:14:28 mmondor Exp $ */ +/* $Id: s_user.c,v 1.7 2005/01/14 07:50:01 mwiggins Exp $ */ #include "struct.h" #include "common.h" @@ -3065,6 +3065,9 @@ m_umode(aClient *cptr, aClient *sptr, int parc, char *parv[]) case 'r': case 'x': case 'X': +#ifdef USE_SSL + case 'S': +#endif break; /* users can't set themselves +r,+x, or +X! */ case 'A': /* set auto +a if user is setting +A */