From 3e86180fb32d5eab15c761b75ba3d4520ef23bac Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 8 Nov 2015 19:25:02 +0100 Subject: [PATCH] various small fixes & example dev config --- config.guess | 2 +- config.sub | 2 +- include/client.h | 6 +- ircd.conf | 265 ++++++++++++++++++++++++++++++++++++++++++++++ ircd/client.c | 20 ++-- ircd/version.c.SH | 2 +- 6 files changed, 281 insertions(+), 16 deletions(-) create mode 100644 ircd.conf diff --git a/config.guess b/config.guess index 10a8260..fb3e6f0 100755 --- a/config.guess +++ b/config.guess @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. diff --git a/config.sub b/config.sub index 8f7b738..33eccb5 100755 --- a/config.sub +++ b/config.sub @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. diff --git a/include/client.h b/include/client.h index 7ad4692..66f9f9d 100644 --- a/include/client.h +++ b/include/client.h @@ -127,7 +127,7 @@ enum Priv PRIV_FORCE_OPMODE, /**< can hack modes on quarantined channels */ PRIV_FORCE_LOCAL_OPMODE, /**< can hack modes on quarantined local channels */ PRIV_APASS_OPMODE, /**< can hack modes +A/-A/+U/-U */ - PRIV_UNLIMIT_FLOOD, /**< user won't get excess flooded */ + PRIV_UNLIMIT_FLOOD, /**< user won't get excess flooded */ PRIV_LAST_PRIV /**< number of privileges */ }; @@ -728,7 +728,7 @@ struct Client { #define SNO_NOISY (SNO_SERVKILL|SNO_UNAUTH) /** Test whether a privilege has been granted to a client. */ -#define HasPriv(cli, priv) FlagHas(client_get_privs(cli), priv) +#define HasPriv(cli, priv) client_get_priv(cli, priv) /** Grant a privilege to a client. */ #define SetPriv(cli, priv) FlagSet(cli_privs(cli), priv) /** Revoke a privilege from a client. */ @@ -751,7 +751,7 @@ extern void client_add_sendq(struct Connection* con, extern void client_set_privs(struct Client *client, struct ConfItem *oper); extern int client_report_privs(struct Client* to, struct Client* client); -extern int client_get_privs(struct Client* client); +extern int client_get_priv(struct Client* client, enum Priv priv); #endif /* INCLUDED_client_h */ diff --git a/ircd.conf b/ircd.conf new file mode 100644 index 0000000..7b56f18 --- /dev/null +++ b/ircd.conf @@ -0,0 +1,265 @@ +General { + name = "ircd.TestIRC"; + description = "IRC SERVER"; + numeric = 1; +}; + +Admin { + Location = "TestIRC IRC Server"; + Location = "IRC Server"; + Contact = "IRC Admin "; +}; + +SSL { + certfile = "ircd.crt"; + keyfile = "ircd.key"; +}; + +Class { + name = "Server"; + pingfreq = 1 minutes 30 seconds; + connectfreq = 5 minutes; + maxlinks = 10; + sendq = 9000000; +}; + +Class { + name = "User"; + pingfreq = 1 minutes 30 seconds; + sendq = 500000; + maxlinks = 2500; +}; + + +Client { + host = "*@*"; + ip = "*@*"; + class = "User"; +}; + +Pseudo "CS" { + name = "ChanServ"; + nick = "ChanServ@services.TestIRC"; +}; + + +motd { + host = "*"; + file = "net_com.motd"; +}; + + +UWorld { + name = "ircd.TestIRC"; #numeric: 1 + name = "services.TestIRC"; #numeric: 2 +}; + +Port { port = 6660; }; +Port { port = 6667; }; +Port { + ssl = yes; + port = 6697; +}; +Port { + ssl = yes; + port = 7776; +}; +Port { port = 8080; }; + +Jupe { + nick = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,{,|,},~,-,_,`"; + nick = "server,svr,serv,sbnc,znc,SpamServ,SpamSvr,staff,admin,team"; + nick = "login,testirc,protocol,pass,newpass,org,irc"; + nick = "StatServ,NoteServ,MemoServ"; + nick = "ChanSvr,ChanSrv,ChanSaver,ChanServ"; + nick = "NickSvr,NickSrv,NickSaver,NickServ"; + nick = "AuthSvr,AuthSrv,AuthSaver,AuthServ"; + nick = "HostSvr,HostSrv,HostSaver,HostServ"; + nick = "Watchdog,Watchcat,Global"; + nick = "LPT1,LPT2,COM1,COM2,COM3,COM4,AUX"; +}; + + # local (or propagate, with the opposite sense) + # whox (log oper's use of x flag with /WHO) + # display (oper status visible to lusers) + # chan_limit (can join local channels when in + # MAXCHANNELSPERUSER channels) + # mode_lchan (can /MODE &channel without chanops) + # deop_lchan (cannot be deopped or kicked on local channels) + # walk_lchan (can forcibly /JOIN &channel OVERRIDE) + # show_invis (see +i users in /WHO x) + # show_all_invis (see +i users in /WHO x) + # unlimit_query (show more results from /WHO) + # local_kill (can kill clients on this server) + # rehash (can use /REHASH) + # restart (can use /RESTART) + # die (can use /DIE) + # local_jupe (not used) + # set (can use /SET) + # local_gline (can set a G-line for this server only) + # local_badchan (can set a Gchan for this server only) + # see_chan (can see users in +s channels in /WHO) + # list_chan (can see +s channels with /LIST S, or modes with /LIST M) + # wide_gline (can use ! to force a wide G-line) + # see_opers (can see opers without DISPLAY privilege) + # local_opmode (can use OPMODE/CLEARMODE on local channels) + # force_local_opmode (can use OPMODE/CLEARMODE on quarantined local channels) + # kill (can kill clients on other servers) + # gline (can issue G-lines to other servers) + # jupe_server (not used) + # opmode (can use /OPMODE) + # badchan (can issue Gchans to other servers) + # force_opmode (can use OPMODE/CLEARMODE on quarantined global channels) + # apass_opmode (can use OPMODE/CLEARMODE on +A and +U keys) + # umode_nochan (can set usermode +n to hide channels) + # umode_noidle (can set usermode +I to hide idle time) + # umode_chserv (can set umode +k) + # umode_xtraop (can set umode +X) + # umode_netserv (can set umode +S) + # umode_overridecc (Allow to set umode +c which overrides cmodes +cC) + # see_idletime (can see idletime of local +I users) + # hide_idletime (hides idle time also from users with see_idletime, unless they are on the same server and have this priv too) + # more_flood (has less throttling) + # unlimited_flood (no more excess floods) + # unlimited_targets (allow unlimited target changes) + # noamsg_override (can override cmode +M) + # + # For global opers (with propagate = yes or local = no), the default + # is to grant all of the above privileges EXCEPT walk_lchan, + # umode_chserv, umode_xtraop, umode_service, + # unlimit_query, set, badchan, local_badchan and apass_opmode. + # For local opers, the default is to grant ONLY the following + # privileges: + # chan_limit, mode_lchan, show_invis, show_all_invis, local_kill, + # rehash, local_gline, local_jupe, local_opmode, whox, display, + # force_local_opmode, see_idletime, hide_channels, hide_idletime, + # more_flood + +Operator { + host = "*@*"; + password = "$SMD5$iX$mNpYBeu8jFyPumMvO6jhT."; + name = "pk910"; + opmode = yes; + mode_lchan = yes; + deop_lchan = yes; + walk_lchan = yes; + unlimit_query = yes; + unlimit_flood = yes; + set = yes; + badchan = yes; + local_badchan = yes; + class = "User"; + local = no; +}; + +features +{ + "LOG" = "SYSTEM" "FILE" "ircd.log"; + "LOG" = "SYSTEM" "LEVEL" "CRIT"; +# "DOMAINNAME"=""; +# "RELIABLE_CLOCK"="FALSE"; +# "BUFFERPOOL"="27000000"; +# "HAS_FERGUSON_FLUSHER"="FALSE"; + "CLIENT_FLOOD"="1024"; + "SERVER_PORT"="13961"; + "NODEFAULTMOTD"="TRUE"; + "MOTD_BANNER"="TRUE"; + "KILL_IPMISMATCH"="FALSE"; + "IDLE_FROM_MSG"="TRUE"; + "HUB"="FALSE"; # change this for user servers + "WALLOPS_OPER_ONLY"="FALSE"; + "NODNS"="FALSE"; + "RANDOM_SEED"="6062596"; + "DEFAULT_LIST_PARAM"="TRUE"; + "NICKNAMEHISTORYLENGTH"="800"; + "NETWORK"="TestIRC"; + "HOST_HIDING"="TRUE"; + "HIDDEN_HOST"="user.TestIRC"; + "HIDDEN_IP"="127.0.0.1"; + "KILLCHASETIMELIMIT"="30"; + "MAXCHANNELSPERUSER"="20"; + "NICKLEN" = "30"; + "AVBANLEN"="40"; + "MAXBANS"="999"; + "MAXSILES"="50"; + "HANGONGOODLINK"="300"; + "HANGONRETRYDELAY" = "10"; + "CONNECTTIMEOUT" = "90"; + "MAXIMUM_LINKS" = "5"; + "PINGFREQUENCY" = "120"; + "CONNECTFREQUENCY" = "60"; + "DEFAULTMAXSENDQLENGTH" = "40000"; + "GLINEMAXUSERCOUNT" = "20"; + "MPATH" = "ircd.motd"; + "RPATH" = "remote.motd"; + "PPATH" = "ircd.pid"; + "TOS_SERVER" = "0x08"; + "TOS_CLIENT" = "0x08"; + "POLLS_PER_LOOP" = "200"; + "IRCD_RES_TIMEOUT" = "4"; + "IRCD_RES_RETRIES" = "2"; + "AUTH_TIMEOUT" = "9"; + "IPCHECK_CLONE_LIMIT" = "100"; + "IPCHECK_CLONE_PERIOD" = "10"; + "IPCHECK_CLONE_DELAY" = "60"; + "CHANNELLEN" = "200"; + "CONFIG_OPERCMDS" = "TRUE"; + "OPLEVELS" = "FALSE"; + "ZANNELS" = "FALSE"; + "LOCAL_CHANNELS" = "FALSE"; + "TOPIC_BURST" = "TRUE"; + "AWAY_BURST" = "TRUE"; + "ANNOUNCE_INVITES" = "TRUE"; +# These were introduced by Undernet CFV-165 to add "Head-In-Sand" (HIS) +# behavior to hide most network topology from users. + "HIS_SNOTICES" = "TRUE"; + "HIS_SNOTICES_OPER_ONLY" = "TRUE"; + "HIS_DEBUG_OPER_ONLY" = "TRUE"; + "HIS_WALLOPS" = "TRUE"; + "HIS_MAP" = "TRUE"; + "HIS_LINKS" = "TRUE"; + "HIS_TRACE" = "TRUE"; + "HIS_STATS_a" = "TRUE"; + "HIS_STATS_c" = "TRUE"; + "HIS_STATS_d" = "TRUE"; + "HIS_STATS_e" = "TRUE"; + "HIS_STATS_f" = "TRUE"; + "HIS_STATS_g" = "TRUE"; + "HIS_STATS_i" = "TRUE"; + "HIS_STATS_j" = "TRUE"; + "HIS_STATS_J" = "TRUE"; + "HIS_STATS_k" = "TRUE"; + "HIS_STATS_l" = "TRUE"; + "HIS_STATS_L" = "TRUE"; + "HIS_STATS_m" = "TRUE"; + "HIS_STATS_M" = "TRUE"; + "HIS_STATS_o" = "TRUE"; + "HIS_STATS_p" = "TRUE"; + "HIS_STATS_q" = "TRUE"; + "HIS_STATS_r" = "TRUE"; + "HIS_STATS_R" = "TRUE"; + "HIS_STATS_t" = "TRUE"; + "HIS_STATS_T" = "TRUE"; + "HIS_STATS_u" = "FALSE"; + "HIS_STATS_U" = "TRUE"; + "HIS_STATS_v" = "TRUE"; + "HIS_STATS_w" = "TRUE"; + "HIS_STATS_x" = "TRUE"; + "HIS_STATS_y" = "TRUE"; + "HIS_STATS_z" = "TRUE"; + "HIS_STATS_IAUTH" = "TRUE"; + "HIS_WHOIS_SERVERNAME" = "TRUE"; + "HIS_WHOIS_IDLETIME" = "FALSE"; + "HIS_WHOIS_LOCALCHAN" = "TRUE"; + "HIS_WHO_SERVERNAME" = "TRUE"; + "HIS_WHO_HOPCOUNT" = "FALSE"; + "HIS_MODEWHO" = "TRUE"; + "HIS_BANWHO" = "TRUE"; + "HIS_KILLWHO" = "TRUE"; + "HIS_REWRITE" = "TRUE"; + "HIS_REMOTE" = "TRUE"; + "HIS_NETSPLIT" = "TRUE"; + "HIS_SERVERNAME" = "*.TestIRC"; + "HIS_SERVERINFO" = "TestIRC"; + "HIS_URLSERVERS" = "http://testirc.nourl"; +}; \ No newline at end of file diff --git a/ircd/client.c b/ircd/client.c index b4d3afe..16367d1 100644 --- a/ircd/client.c +++ b/ircd/client.c @@ -265,18 +265,18 @@ client_report_privs(struct Client *to, struct Client *client) return 0; } -int client_get_privs(struct Client* client) { - int privs = cli_privs(client); - - // add privs from class - struct SLink *list; - - for (list = cli_confs(cptr); list != NULL; list = list->next) { +int client_get_priv(struct Client* client, enum Priv priv) { + struct Privs *privs = &cli_privs(client); + struct SLink* list; + if(FlagHas(privs, priv)) + return 1; + + for (list = cli_confs(client); list != NULL; list = list->next) { struct ConfItem *aconf; aconf = list->value.aconf; - if (aconf->status & CONF_CLIENT) - privs |= aconf->privs; + if (FlagHas(&aconf->privs, priv)) + return 1; } - return privs; + return 0; } diff --git a/ircd/version.c.SH b/ircd/version.c.SH index fca1804..38b5d6b 100644 --- a/ircd/version.c.SH +++ b/ircd/version.c.SH @@ -1,4 +1,4 @@ -#! /bin/sh +#!/bin/sh # $Id$ -- 2.20.1