"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/conf_parser.y" between
ircd-hybrid-8.2.27.tgz and ircd-hybrid-8.2.28.tgz

About: IRCD-Hybrid is a Internet Relay Chat server.

conf_parser.y  (ircd-hybrid-8.2.27.tgz):conf_parser.y  (ircd-hybrid-8.2.28.tgz)
skipping to change at line 24 skipping to change at line 24
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA * USA
*/ */
/*! \file conf_parser.y /*! \file conf_parser.y
* \brief Parses the ircd configuration file. * \brief Parses the ircd configuration file.
* \version $Id: conf_parser.y 9156 2020-01-13 14:51:47Z michael $ * \version $Id: conf_parser.y 9208 2020-01-25 16:01:18Z michael $
*/ */
%{ %{
#include "config.h" #include "config.h"
#include "stdinc.h" #include "stdinc.h"
#include "ircd.h" #include "ircd.h"
#include "list.h" #include "list.h"
#include "parse.h" #include "parse.h"
#include "conf.h" #include "conf.h"
skipping to change at line 436 skipping to change at line 436
add_conf_module(libio_basename(yylval.string)); add_conf_module(libio_basename(yylval.string));
}; };
modules_path: PATH '=' QSTRING ';' modules_path: PATH '=' QSTRING ';'
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
mod_add_path(yylval.string); mod_add_path(yylval.string);
}; };
/*************************************************************************** /***************************************************************************
* serverinfo {} section * serverinfo {} section
***************************************************************************/ ***************************************************************************/
serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';'; serverinfo_entry: SERVERINFO '{' serverinfo_items '}' ';';
serverinfo_items: serverinfo_items serverinfo_item | serverinfo_item ; serverinfo_items: serverinfo_items serverinfo_item | serverinfo_item ;
serverinfo_item: serverinfo_name | serverinfo_item: serverinfo_name |
serverinfo_hub | serverinfo_hub |
serverinfo_description | serverinfo_description |
serverinfo_network_name | serverinfo_network_name |
serverinfo_network_desc | serverinfo_network_desc |
serverinfo_default_max_clients | serverinfo_default_max_clients |
skipping to change at line 566 skipping to change at line 566
xfree(ConfigServerInfo.description); xfree(ConfigServerInfo.description);
ConfigServerInfo.description = xstrdup(yylval.string); ConfigServerInfo.description = xstrdup(yylval.string);
strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info)); strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info));
} }
}; };
serverinfo_network_name: NETWORK_NAME '=' QSTRING ';' serverinfo_network_name: NETWORK_NAME '=' QSTRING ';'
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
{ {
char *p; char *p = strchr(yylval.string, ' ');
if ((p = strchr(yylval.string, ' '))) if (p)
*p = '\0'; *p = '\0';
xfree(ConfigServerInfo.network_name); xfree(ConfigServerInfo.network_name);
ConfigServerInfo.network_name = xstrdup(yylval.string); ConfigServerInfo.network_name = xstrdup(yylval.string);
} }
}; };
serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';' serverinfo_network_desc: NETWORK_DESC '=' QSTRING ';'
{ {
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
skipping to change at line 597 skipping to change at line 597
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
if ($3 < 1) if ($3 < 1)
{ {
conf_error_report("default_max_clients too low, setting to 1"); conf_error_report("default_max_clients too low, setting to 1");
ConfigServerInfo.default_max_clients = 1; ConfigServerInfo.default_max_clients = 1;
} }
else if ($3 > MAXCLIENTS_MAX) else if ($3 > MAXCLIENTS_MAX)
{ {
char buf[IRCD_BUFSIZE] = ""; char buf[IRCD_BUFSIZE];
snprintf(buf, sizeof(buf), "default_max_clients too high, setting to %d", MA XCLIENTS_MAX); snprintf(buf, sizeof(buf), "default_max_clients too high, setting to %d", MA XCLIENTS_MAX);
conf_error_report(buf); conf_error_report(buf);
ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX; ConfigServerInfo.default_max_clients = MAXCLIENTS_MAX;
} }
else else
ConfigServerInfo.default_max_clients = $3; ConfigServerInfo.default_max_clients = $3;
}; };
skipping to change at line 620 skipping to change at line 620
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
if ($3 < 9) if ($3 < 9)
{ {
conf_error_report("max_nick_length too low, setting to 9"); conf_error_report("max_nick_length too low, setting to 9");
ConfigServerInfo.max_nick_length = 9; ConfigServerInfo.max_nick_length = 9;
} }
else if ($3 > NICKLEN) else if ($3 > NICKLEN)
{ {
char buf[IRCD_BUFSIZE] = ""; char buf[IRCD_BUFSIZE];
snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLE N); snprintf(buf, sizeof(buf), "max_nick_length too high, setting to %d", NICKLE N);
conf_error_report(buf); conf_error_report(buf);
ConfigServerInfo.max_nick_length = NICKLEN; ConfigServerInfo.max_nick_length = NICKLEN;
} }
else else
ConfigServerInfo.max_nick_length = $3; ConfigServerInfo.max_nick_length = $3;
}; };
skipping to change at line 643 skipping to change at line 643
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
if ($3 < 80) if ($3 < 80)
{ {
conf_error_report("max_topic_length too low, setting to 80"); conf_error_report("max_topic_length too low, setting to 80");
ConfigServerInfo.max_topic_length = 80; ConfigServerInfo.max_topic_length = 80;
} }
else if ($3 > TOPICLEN) else if ($3 > TOPICLEN)
{ {
char buf[IRCD_BUFSIZE] = ""; char buf[IRCD_BUFSIZE];
snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPIC LEN); snprintf(buf, sizeof(buf), "max_topic_length too high, setting to %d", TOPIC LEN);
conf_error_report(buf); conf_error_report(buf);
ConfigServerInfo.max_topic_length = TOPICLEN; ConfigServerInfo.max_topic_length = TOPICLEN;
} }
else else
ConfigServerInfo.max_topic_length = $3; ConfigServerInfo.max_topic_length = $3;
}; };
skipping to change at line 707 skipping to change at line 707
/*************************************************************************** /***************************************************************************
* motd {} section * motd {} section
***************************************************************************/ ***************************************************************************/
motd_entry: MOTD motd_entry: MOTD
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
reset_block_state(); reset_block_state();
} '{' motd_items '}' ';' } '{' motd_items '}' ';'
{ {
dlink_node *node = NULL; dlink_node *node;
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
if (!block_state.file.buf[0]) if (!block_state.file.buf[0])
break; break;
DLINK_FOREACH(node, block_state.mask.list.head) DLINK_FOREACH(node, block_state.mask.list.head)
motd_add(node->data, block_state.file.buf); motd_add(node->data, block_state.file.buf);
}; };
skipping to change at line 798 skipping to change at line 798
nuh.usersize = sizeof(block_state.nick.buf); nuh.usersize = sizeof(block_state.nick.buf);
nuh.hostsize = sizeof(block_state.host.buf); nuh.hostsize = sizeof(block_state.host.buf);
split_nuh(&nuh); split_nuh(&nuh);
} }
}; };
/*************************************************************************** /***************************************************************************
* log {} section * log {} section
***************************************************************************/ ***************************************************************************/
logging_entry: T_LOG '{' logging_items '}' ';' ; logging_entry: T_LOG '{' logging_items '}' ';' ;
logging_items: logging_items logging_item | logging_item ; logging_items: logging_items logging_item | logging_item ;
logging_item: logging_use_logging | logging_file_entry | logging_item: logging_use_logging | logging_file_entry |
error ';' ; error ';' ;
logging_use_logging: USE_LOGGING '=' TBOOL ';' logging_use_logging: USE_LOGGING '=' TBOOL ';'
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
ConfigLog.use_logging = yylval.number; ConfigLog.use_logging = yylval.number;
}; };
skipping to change at line 850 skipping to change at line 850
block_state.size.value = $3; block_state.size.value = $3;
} | T_SIZE '=' T_UNLIMITED ';' } | T_SIZE '=' T_UNLIMITED ';'
{ {
block_state.size.value = 0; block_state.size.value = 0;
}; };
logging_file_type: TYPE logging_file_type: TYPE
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.type.value = 0; block_state.type.value = 0;
} '=' logging_file_type_items ';' ; } '=' logging_file_type_items ';' ;
logging_file_type_items: logging_file_type_items ',' logging_file_type_item | lo gging_file_type_item; logging_file_type_items: logging_file_type_items ',' logging_file_type_item | lo gging_file_type_item;
logging_file_type_item: USER logging_file_type_item: USER
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.type.value = LOG_TYPE_USER; block_state.type.value = LOG_TYPE_USER;
} | OPERATOR } | OPERATOR
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.type.value = LOG_TYPE_OPER; block_state.type.value = LOG_TYPE_OPER;
skipping to change at line 899 skipping to change at line 899
***************************************************************************/ ***************************************************************************/
oper_entry: OPERATOR oper_entry: OPERATOR
{ {
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
reset_block_state(); reset_block_state();
block_state.flags.value |= CONF_FLAGS_ENCRYPTED; block_state.flags.value |= CONF_FLAGS_ENCRYPTED;
} '{' oper_items '}' ';' } '{' oper_items '}' ';'
{ {
dlink_node *node = NULL; dlink_node *node;
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
if (!block_state.name.buf[0]) if (!block_state.name.buf[0])
break; break;
if (!block_state.rpass.buf[0]) if (!block_state.rpass.buf[0])
break; break;
skipping to change at line 1028 skipping to change at line 1028
oper_class: CLASS '=' QSTRING ';' oper_class: CLASS '=' QSTRING ';'
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)) ; strlcpy(block_state.class.buf, yylval.string, sizeof(block_state.class.buf)) ;
}; };
oper_umodes: T_UMODES oper_umodes: T_UMODES
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.modes.value = 0; block_state.modes.value = 0;
} '=' oper_umodes_items ';' ; } '=' oper_umodes_items ';' ;
oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item; oper_umodes_items: oper_umodes_items ',' oper_umodes_item | oper_umodes_item;
oper_umodes_item: T_BOTS oper_umodes_item: T_BOTS
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.modes.value |= UMODE_BOTS; block_state.modes.value |= UMODE_BOTS;
} | T_CCONN } | T_CCONN
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.modes.value |= UMODE_CCONN; block_state.modes.value |= UMODE_CCONN;
skipping to change at line 1129 skipping to change at line 1129
} | EXPIRATION } | EXPIRATION
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.modes.value |= UMODE_EXPIRATION; block_state.modes.value |= UMODE_EXPIRATION;
}; };
oper_flags: IRCD_FLAGS oper_flags: IRCD_FLAGS
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.port.value = 0; block_state.port.value = 0;
} '=' oper_flags_items ';'; } '=' oper_flags_items ';';
oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item; oper_flags_items: oper_flags_items ',' oper_flags_item | oper_flags_item;
oper_flags_item: KILL ':' REMOTE oper_flags_item: KILL ':' REMOTE
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.port.value |= OPER_FLAG_KILL_REMOTE; block_state.port.value |= OPER_FLAG_KILL_REMOTE;
} | KILL } | KILL
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.port.value |= OPER_FLAG_KILL; block_state.port.value |= OPER_FLAG_KILL;
skipping to change at line 1423 skipping to change at line 1423
break; break;
block_state.max_idle.value = $3; block_state.max_idle.value = $3;
block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE; block_state.flags.value |= CLASS_FLAGS_FAKE_IDLE;
}; };
class_flags: IRCD_FLAGS class_flags: IRCD_FLAGS
{ {
if (conf_parser_ctx.pass == 1) if (conf_parser_ctx.pass == 1)
block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE; block_state.flags.value &= CLASS_FLAGS_FAKE_IDLE;
} '=' class_flags_items ';'; } '=' class_flags_items ';';
class_flags_items: class_flags_items ',' class_flags_item | class_flags_item; class_flags_items: class_flags_items ',' class_flags_item | class_flags_item;
class_flags_item: RANDOM_IDLE class_flags_item: RANDOM_IDLE
{ {
if (conf_parser_ctx.pass == 1) if (conf_parser_ctx.pass == 1)
block_state.flags.value |= CLASS_FLAGS_RANDOM_IDLE; block_state.flags.value |= CLASS_FLAGS_RANDOM_IDLE;
} | HIDE_IDLE_FROM_OPERS } | HIDE_IDLE_FROM_OPERS
{ {
if (conf_parser_ctx.pass == 1) if (conf_parser_ctx.pass == 1)
block_state.flags.value |= CLASS_FLAGS_HIDE_IDLE_FROM_OPERS; block_state.flags.value |= CLASS_FLAGS_HIDE_IDLE_FROM_OPERS;
skipping to change at line 1448 skipping to change at line 1448
***************************************************************************/ ***************************************************************************/
listen_entry: LISTEN listen_entry: LISTEN
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
reset_block_state(); reset_block_state();
} '{' listen_items '}' ';'; } '{' listen_items '}' ';';
listen_flags: IRCD_FLAGS listen_flags: IRCD_FLAGS
{ {
block_state.flags.value = 0; block_state.flags.value = 0;
} '=' listen_flags_items ';'; } '=' listen_flags_items ';';
listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item ; listen_flags_items: listen_flags_items ',' listen_flags_item | listen_flags_item ;
listen_flags_item: T_TLS listen_flags_item: T_TLS
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.flags.value |= LISTENER_TLS; block_state.flags.value |= LISTENER_TLS;
} | HIDDEN } | HIDDEN
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
block_state.flags.value |= LISTENER_HIDDEN; block_state.flags.value |= LISTENER_HIDDEN;
skipping to change at line 1523 skipping to change at line 1523
/*************************************************************************** /***************************************************************************
* auth {} section * auth {} section
***************************************************************************/ ***************************************************************************/
auth_entry: IRCD_AUTH auth_entry: IRCD_AUTH
{ {
if (conf_parser_ctx.pass == 2) if (conf_parser_ctx.pass == 2)
reset_block_state(); reset_block_state();
} '{' auth_items '}' ';' } '{' auth_items '}' ';'
{ {
dlink_node *node = NULL; dlink_node *node;
if (conf_parser_ctx.pass != 2) if (conf_parser_ctx.pass != 2)
break; break;
DLINK_FOREACH(node, block_state.mask.list.head) DLINK_FOREACH(node, block_state.mask.list.head)
{ {
struct split_nuh_item nuh; struct split_nuh_item nuh;
char *s = node->data; char *s = node->data;
if (EmptyString(s)) if (EmptyString(s))
skipping to change at line 1557 skipping to change at line 1557
struct MaskItem *conf = conf_make(CONF_CLIENT); struct MaskItem *conf = conf_make(CONF_CLIENT);
conf->user = xstrdup(block_state.user.buf); conf->user = xstrdup(block_state.user.buf);
conf->host = xstrdup(block_state.host.buf); conf->host = xstrdup(block_state.host.buf);
if (block_state.rpass.buf[0]) if (block_state.rpass.buf[0])
conf->passwd = xstrdup(block_state.rpass.buf); conf->passwd = xstrdup(block_state.rpass.buf);
if (block_state.name.buf[0]) if (block_state.name.buf[0])
conf->name = xstrdup(block_state.name.buf); conf->name = xstrdup(block_state.name.buf);
conf->flags = block_state.flags.value; conf->flags = block_state.flags.value;
conf->port = block_state.port.value; conf->port = block_state.port.value;
conf_add_class_to_conf(conf, block_state.class.buf); conf_add_class_to_conf(conf, block_state.class.buf);
add_conf_by_address(CONF_CLIENT, conf); add_conf_by_address(CONF_CLIENT, conf);
} }
}; };
auth_items: auth_items auth_item | auth_item; auth_items: auth_items auth_item | auth_item;
auth_item: auth_user | auth_item: auth_user |
auth_passwd | auth_passwd |
auth_class | auth_class |
 End of changes. 17 change blocks. 
17 lines changed or deleted 17 lines changed or added

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