From 7fcefa41afcc1ec9a55f6b68a3e27e1017611b42 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 31 Aug 2017 14:33:23 -0700 Subject: [PATCH 1/6] example-conf: remove wrong advice regarding P10 extended_accounts Clearly I misread readme.features, oops. (cherry picked from commit 7f112e3c661ff19c1317df84228eb9ab7489ed41) --- example-conf.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/example-conf.yml b/example-conf.yml index e25c52e..b8a4086 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -296,8 +296,6 @@ servers: ### The following options are specific to P10 servers: # Determines whether extended accounts should be used for this network. # For Nefarious, this **MUST** match the EXTENDED_ACCOUNTS setting in your IRCd configuration. - # Disable this if you are using X3, and leave it on for any other service package - # (atheme, etc.) # For other P10 IRCds, this should be set to FALSE. use_extended_accounts: true From dd5a0c489217d74f5387600305a8fd83d8c599d3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 11 Aug 2017 12:19:23 -0700 Subject: [PATCH 2/6] ts6: fallback realhost to host, not None (cherry picked from commit dfa90378dfd056ade41c18ba213cd8408fc237b6) --- protocols/ts6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/ts6.py b/protocols/ts6.py index 9128b33..d928203 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -502,7 +502,7 @@ class TS6Protocol(TS6BaseProtocol): self.check_nick_collision(nick) ts, modes, ident, host, ip, uid, realhost, accountname, realname = args[2:11] if realhost == '*': - realhost = None + realhost = host log.debug('(%s) handle_euid got args: nick=%s ts=%s uid=%s ident=%s ' 'host=%s realname=%s realhost=%s ip=%s', self.irc.name, nick, ts, uid, From 32130a798828fcae19643081420c85e3929e0106 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 31 Jul 2017 00:55:35 +0800 Subject: [PATCH 3/6] channel/user-modes.csv: add RFC1459 & ngIRCd columns (cherry picked from commit 0a56ab662bbb01ecc23f4de8dae955333a8b8eb4) --- docs/technical/channel-modes.csv | 118 +++++++++++++++---------------- docs/technical/user-modes.csv | 101 +++++++++++++------------- 2 files changed, 111 insertions(+), 108 deletions(-) diff --git a/docs/technical/channel-modes.csv b/docs/technical/channel-modes.csv index 3749806..366edfa 100644 --- a/docs/technical/channel-modes.csv +++ b/docs/technical/channel-modes.csv @@ -1,59 +1,59 @@ -Channel Mode / IRCd,InspIRCd,charybdis,Elemental-IRCd,UnrealIRCd,IRCd-Hybrid,Nefarious IRCu,ircd-ratbox,snircd,IRCu -admin,a (m_customprefix/m_chanprotect),,a (when enabled),a,,,,, -adminonly,,A (extensions/chm_adminonly),A (extensions/chm_adminonly.c),,,a,,, -allowinvite,A (m_allowinvite),g,g,,,,,, -autoop,w (m_autoop),,,,,,,, -ban,b,b,b,b,b,b,b,b,b -banexception,e (m_banexception),e,e,e,e,e,e,, -blockcaps,B (m_blockcaps),,G (extensions/chm_nocaps.c),,,,,, -blockcolor,c (m_blockcolor),,,c,c,c,,c,c -delayjoin,,,,D,,D,,D,D -exemptchanops,X (m_exemptchanops),,,,,,,, -filter,g (m_filter),,,,,,,, -flood,f (m_messageflood),,,,,,,, -flood_unreal,,,,f,,,,, -freetarget,,F,F,,,,,, -had_delayjoin,,,,,,d,,d,d -halfop,h (m_customprefix/m_halfop),,h (when enabled),h,h,,,, -hiddenbans,,,u,,,,,, -hidequits,,,,,,Q,,u, -history,H (m_chanhistory),,,,,,,, -invex,I (m_inviteexception),I,I,I,I,,I,, -inviteonly,i,i,i,i,i,i,i,i,i -issecure,,,,Z,,,,, -joinflood,j (m_joinflood),j,j,,,,,, -key,k,k,k,k,k,k,k,k,k -kicknorejoin,J (m_kicknorejoin),,J,,,,,, -largebanlist,,L,L,,,,,, -limit,l,l,l,l,l,l,l,l,l -moderated,m,m,m,m,m,m,m,m,m -nickflood,F (m_nickflood),,,,,,,, -noamsg,,,,,,T,,T, -noctcp,C (m_noctcp),C,C,C,C,C,,C,C -noextmsg,n,n,n,n,n,n,n,, -noforwards,,Q,Q,,,,,, -noinvite,,,,V,,,,, -nokick,Q (m_nokicks),,E,Q,,,,, -noknock,K (m_knock),p,,K,p,,,, -nonick,N (m_nonicks),,d,N,,,,, -nonotice,T (m_nonotice),T (extensions/chm_nonotice),T,T,,N,,N, -official-join,Y (m_ojoin),,,,,,,, -op,o,o,o,o,o,o,o,o,o -operonly,O (m_operchans),O (extensions/chm_operonly),O (extensions/chm_operonly.c),O,O,O,,, -oplevel_apass,,,,,,A,,A,A -oplevel_upass,,,,,,U,,U,U -opmoderated,U (extras/m_opmoderated),z,z,,,,,, -owner,q (m_customprefix/m_chanprotect),,y (when enabled),q,,,,, -permanent,P (m_permchannels),P,P,P,,z,,, -private,p,,,p,,p,p,p,p -quiet,,q,q,,,,,, -redirect,L (m_redirect),f,f,L,,L,,, -registered,r (m_services_account),,,r,r,R,,R,R -regmoderated,M (m_services_account),,,M,M,M,,M, -regonly,R (m_services_account),r,r,R,R,r,r,r,r -repeat,E (m_repeat),,K (extensions/chm_norepeat.c),,,,,, -secret,s,s,s,s,s,s,s,s,s -sslonly,z (m_sslmodes),S (extensions/chm_sslonly),S (extensions/chm_sslonly.c),z,S,,S,, -stripcolor,S (m_stripcolor),c,c,S,,S,,, -topiclock,t,t,t,t,t,t,t,t,t -voice,v,v,v,v,v,v,v,v,v +Channel Mode / IRCd,RFC1459,InspIRCd,charybdis,Elemental-IRCd,UnrealIRCd,IRCd-Hybrid,Nefarious IRCu,ircd-ratbox,snircd,IRCu,ngIRCd +admin,,a (m_customprefix/m_chanprotect),,a (when enabled),a,,,,,, +adminonly,,,A (extensions/chm_adminonly),A (extensions/chm_adminonly.c),,,a,,,, +allowinvite,,A (m_allowinvite),g,g,,,,,,, +autoop,,w (m_autoop),,,,,,,,, +ban,b,b,b,b,b,b,b,b,b,b,b +banexception,,e (m_banexception),e,e,e,e,e,e,,,e +blockcaps,,B (m_blockcaps),,G (extensions/chm_nocaps.c),,,,,,, +blockcolor,,c (m_blockcolor),,,c,c,c,,c,c, +delayjoin,,,,,D,,D,,D,D, +exemptchanops,,X (m_exemptchanops),,,,,,,,, +filter,,g (m_filter),,,,,,,,, +flood,,f (m_messageflood),,,,,,,,, +flood_unreal,,,,,f,,,,,, +freetarget,,,F,F,,,,,,, +had_delayjoin,,,,,,,d,,d,d, +halfop,,h (m_customprefix/m_halfop),,h (when enabled),h,h,,,,, +hiddenbans,,,,u,,,,,,, +hidequits,,,,,,,Q,,u,, +history,,H (m_chanhistory),,,,,,,,, +invex,,I (m_inviteexception),I,I,I,I,,I,,,I +inviteonly,i,i,i,i,i,i,i,i,i,i,i +issecure,,,,,Z,,,,,, +joinflood,,j (m_joinflood),j,j,,,,,,, +key,k,k,k,k,k,k,k,k,k,k,k +kicknorejoin,,J (m_kicknorejoin),,J,,,,,,, +largebanlist,,,L,L,,,,,,, +limit,l,l,l,l,l,l,l,l,l,l,l +moderated,m,m,m,m,m,m,m,m,m,m,m +nickflood,,F (m_nickflood),,,,,,,,, +noamsg,,,,,,,T,,T,, +noctcp,,C (m_noctcp),C,C,C,C,C,,C,C, +noextmsg,n,n,n,n,n,n,n,n,,,n +noforwards,,,Q,Q,,,,,,, +noinvite,,,,,V,,,,,,V +nokick,,Q (m_nokicks),,E,Q,,,,,,Q +noknock,,K (m_knock),p,,K,p,,,,, +nonick,,N (m_nonicks),,d,N,,,,,,N +nonotice,,T (m_nonotice),T (extensions/chm_nonotice),T,T,,N,,N,, +official-join,,Y (m_ojoin),,,,,,,,, +op,o,o,o,o,o,o,o,o,o,o,o +operonly,,O (m_operchans),O (extensions/chm_operonly),O (extensions/chm_operonly.c),O,O,O,,,,O +oplevel_apass,,,,,,,A,,A,A, +oplevel_upass,,,,,,,U,,U,U, +opmoderated,,U (extras/m_opmoderated),z,z,,,,,,, +owner,,q (m_customprefix/m_chanprotect),,y (when enabled),q,,,,,, +permanent,,P (m_permchannels),P,P,P,,z,,,,P +private,p,p,,,p,,p,p,p,p,p +quiet,,,q,q,,,,,,, +redirect,,L (m_redirect),f,f,L,,L,,,, +registered,,r (m_services_account),,,r,r,R,,R,R,r +regmoderated,,M (m_services_account),,,M,M,M,,M,,M +regonly,,R (m_services_account),r,r,R,R,r,r,r,r,R +repeat,,E (m_repeat),,K (extensions/chm_norepeat.c),,,,,,, +secret,s,s,s,s,s,s,s,s,s,s,s +sslonly,,z (m_sslmodes),S (extensions/chm_sslonly),S (extensions/chm_sslonly.c),z,S,,S,,,z +stripcolor,,S (m_stripcolor),c,c,S,,S,,,, +topiclock,t,t,t,t,t,t,t,t,t,t,t +voice,v,v,v,v,v,v,v,v,v,v,v diff --git a/docs/technical/user-modes.csv b/docs/technical/user-modes.csv index c6a7b4f..c036c47 100644 --- a/docs/technical/user-modes.csv +++ b/docs/technical/user-modes.csv @@ -1,49 +1,52 @@ -User Mode / IRCd,InspIRCd,charybdis,Elemental-IRCd,UnrealIRCd,IRCd-Hybrid,Nefarious IRCu,ircd-ratbox,snircd,IRCu -admin,,a,a,,a,a,a,, -bot,B,,B,B,,B,,, -callerid,g,g,g,,g,,g,, -cloak,x,x,x,x,x,x,,x,x -cloak_fakehost,,,,,,f,,, -cloak_hashedhost,,,,,,C,,, -cloak_hashedip,,,,,,c,,, -cloak_sethost,,,,,,h,,h, -deaf,d,D,D,d,D,d,D,d,d -deaf_commonchan,c,,,,G,q,,, -debug,,,,,d,,,, -filter,,,,G,,,,, -helpop,h,,,,,,,, -hidechans,I,,I,p,p,n,,n, -hideidle,,,,I,q,I,,I, -hideoper,H,,,H,H,H,,, -invisible,i,i,i,i,i,i,i,i,i -locops,,l,l,,l,O,l,O,O -noctcp,,,C,T,,,,, -noforward,,Q,Q,,,L,,, -noinvite,,,V,,,,,, -oper,o,o,o,,o,o,o,o,o -operwall,,z,z,,,,z,, -override,,p,p,,,X,,X, -privdeaf,,,,,,D,,, -protected,,,,q,,,,, -regdeaf,R,R,R,R,R,R,,R, -registered,r,,,r,r,r,,r,r -servprotect,k,S,S,S,,k,S,k,k -showwhois,W,,,W,,W,,, -sno_admin_requests,,,,,y,,y,, -sno_badclientconnections,,,,,u,,u,, -sno_botfloods,,,,,b,,b,, -sno_clientconnections,,,,,c,,c,, -sno_debug,,,,,,g,d,g,g -sno_extclientconnections,,,,,,,C,, -sno_fullauthblock,,,,,f,,f,, -sno_nickchange,,,,,n,,,, -sno_rejectedclients,,,,,j,,r,, -sno_remoteclientconnections,,,,,F,,,, -sno_server_connects,,,,,e,,x,, -sno_skill,,,,,k,,k,, -snomask,s,s,s,s,s,s,s,, -ssl,,,,z,S,z,,, -stripcolor,S,,,,,,,, -vhost,,,,t,,,,, -wallops,w,w,w,w,w,w,w,, -webirc,,,,,W,,,, +User Mode / IRCd,RFC1459,InspIRCd,charybdis,Elemental-IRCd,UnrealIRCd,IRCd-Hybrid,Nefarious IRCu,ircd-ratbox,snircd,IRCu,ngIRCd +admin,,,a,a,,a,a,a,,, +away,,,,,,,,,,,a +bot,,B,,B,B,,B,,,,B +callerid,,g,g,g,,g,,g,,, +cloak,,x,x,x,x,x,x,,x,x,x +cloak_fakehost,,,,,,,f,,,, +cloak_hashedhost,,,,,,,C,,,, +cloak_hashedip,,,,,,,c,,,, +cloak_sethost,,,,,,,h,,h,, +deaf,,d,D,D,d,D,d,D,d,d,b +deaf_commonchan,,c,,,,G,q,,,,C +debug,,,,,,d,,,,, +filter,,,,,G,,,,,, +floodexempt,,,,,,,,,,,f +helpop,,h,,,,,,,,, +hidechans,,I,,I,p,p,n,,n,,I +hideidle,,,,,I,q,I,,I,, +hideoper,,H,,,H,H,H,,,, +invisible,i,i,i,i,i,i,i,i,i,i,i +locops,,,l,l,,l,O,l,O,O, +noctcp,,,,C,T,,,,,, +noforward,,,Q,Q,,,L,,,, +noinvite,,,,V,,,,,,, +oper,o,o,o,o,o,o,o,o,o,o,o +operwall,,,z,z,,,,z,,, +override,,,p,p,,,X,,X,, +privdeaf,,,,,,,D,,,, +protected,,,,,q,,,,,, +regdeaf,,R,R,R,R,R,R,,R,, +registered,,r,,,r,r,r,,r,r,R +restricted,,,,,,,,,,,r +servprotect,,k,S,S,S,,k,S,k,k,q +showwhois,,W,,,W,,W,,,, +sno_admin_requests,,,,,,y,,y,,, +sno_badclientconnections,,,,,,u,,u,,, +sno_botfloods,,,,,,b,,b,,, +sno_clientconnections,,,,,,c,,c,,,c +sno_debug,,,,,,,g,d,g,g, +sno_extclientconnections,,,,,,,,C,,, +sno_fullauthblock,,,,,,f,,f,,, +sno_nickchange,,,,,,n,,,,, +sno_rejectedclients,,,,,,j,,r,,, +sno_remoteclientconnections,,,,,,F,,,,, +sno_server_connects,,,,,,e,,x,,, +sno_skill,,,,,,k,,k,,, +snomask,s,s,s,s,s,s,s,s,,,s +ssl,,,,,z,S,z,,,, +stripcolor,,S,,,,,,,,, +vhost,,,,,t,,,,,, +wallops,w,w,w,w,w,w,w,w,,,w +webirc,,,,,,W,,,,, From a03214514c697087972289aac8e6cf5e9732ddca Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 11 Aug 2017 13:45:40 -0700 Subject: [PATCH 4/6] hybrid, ts6, ratbox: fix +p mode definitions properly +p is noknock and rfc1459-style private on all 3 IRCds, though the latter bit is undocumented in /help cmodes (maybe it's assumed?) +p is also "paranoia" on hybrid, which adds more restrictions to halfops and /invite (cherry picked from commit c107f0062ffb25a54d52946a26725940865318bb) --- docs/technical/channel-modes.csv | 3 ++- protocols/hybrid.py | 6 ++++-- protocols/ratbox.py | 2 +- protocols/ts6.py | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/technical/channel-modes.csv b/docs/technical/channel-modes.csv index 366edfa..1eaf433 100644 --- a/docs/technical/channel-modes.csv +++ b/docs/technical/channel-modes.csv @@ -44,8 +44,9 @@ oplevel_apass,,,,,,,A,,A,A, oplevel_upass,,,,,,,U,,U,U, opmoderated,,U (extras/m_opmoderated),z,z,,,,,,, owner,,q (m_customprefix/m_chanprotect),,y (when enabled),q,,,,,, +paranoia,,,,,,p,,,,, permanent,,P (m_permchannels),P,P,P,,z,,,,P -private,p,p,,,p,,p,p,p,p,p +private,p,p,,,p,,p,,p,p,p quiet,,,q,q,,,,,,, redirect,,L (m_redirect),f,f,L,,L,,,, registered,,r (m_services_account),,,r,r,R,,R,R,r diff --git a/protocols/hybrid.py b/protocols/hybrid.py index e22e85e..6fa4903 100644 --- a/protocols/hybrid.py +++ b/protocols/hybrid.py @@ -23,16 +23,18 @@ class HybridProtocol(TS6Protocol): f = self.irc.send # https://github.com/grawity/irc-docs/blob/master/server/ts6.txt#L80 + # Note: according to hybrid source code, +p is paranoia, noknock, + # AND rfc1459-style private, though the last isn't documented. cmodes = { # TS6 generic modes: 'op': 'o', 'halfop': 'h', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit': 'l', 'moderated': 'm', 'noextmsg': 'n', - 'secret': 's', 'topiclock': 't', + 'secret': 's', 'topiclock': 't', 'private': 'p', # hybrid-specific modes: 'blockcolor': 'c', 'inviteonly': 'i', 'noctcp': 'C', 'regmoderated': 'M', 'operonly': 'O', 'regonly': 'R', 'sslonly': 'S', 'banexception': 'e', 'noknock': 'p', - 'registered': 'r', 'invex': 'I', + 'registered': 'r', 'invex': 'I', 'paranoia': 'p', # Now, map all the ABCD type modes: '*A': 'beI', '*B': 'k', '*C': 'l', '*D': 'cimnprstCMORS' } diff --git a/protocols/ratbox.py b/protocols/ratbox.py index fbf73cd..368fe5c 100644 --- a/protocols/ratbox.py +++ b/protocols/ratbox.py @@ -22,7 +22,7 @@ class RatboxProtocol(TS6Protocol): # Note: +r, +e, and +I support will be negotiated on link self.irc.cmodes = {'op': 'o', 'secret': 's', 'private': 'p', 'noextmsg': 'n', 'moderated': 'm', 'inviteonly': 'i', 'topiclock': 't', 'limit': 'l', 'ban': 'b', 'voice': 'v', - 'key': 'k', 'sslonly': 'S', + 'key': 'k', 'sslonly': 'S', 'noknock': 'p', '*A': 'beI', '*B': 'k', '*C': 'l', diff --git a/protocols/ts6.py b/protocols/ts6.py index d928203..c3b62b5 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -267,6 +267,7 @@ class TS6Protocol(TS6BaseProtocol): 'op': 'o', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit': 'l', 'moderated': 'm', 'noextmsg': 'n', 'noknock': 'p', 'secret': 's', 'topiclock': 't', 'inviteonly': 'i', + 'private': 'p', # charybdis-specific modes: 'quiet': 'q', 'redirect': 'f', 'freetarget': 'F', 'joinflood': 'j', 'largebanlist': 'L', 'permanent': 'P', From 1f270c985f4664967e76755279fb58ae0763e8a8 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 11 Aug 2017 15:09:53 -0700 Subject: [PATCH 5/6] hybrid: drop EX and IE from required capabilities This fixes compatibility with hybrid trunk, commit ircd-hybrid/ircd-hybrid@981c61e36cf0f78d2a90bd2bcf4c86ae510d7cc4 (cherry picked from commit 30dc4a2b27d6b6e6d68b0d154fbafd737207596e) Conflicts: protocols/hybrid.py --- protocols/hybrid.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocols/hybrid.py b/protocols/hybrid.py index 6fa4903..2313307 100644 --- a/protocols/hybrid.py +++ b/protocols/hybrid.py @@ -35,6 +35,7 @@ class HybridProtocol(TS6Protocol): 'regmoderated': 'M', 'operonly': 'O', 'regonly': 'R', 'sslonly': 'S', 'banexception': 'e', 'noknock': 'p', 'registered': 'r', 'invex': 'I', 'paranoia': 'p', + 'banexception': 'e', # Now, map all the ABCD type modes: '*A': 'beI', '*B': 'k', '*C': 'l', '*D': 'cimnprstCMORS' } @@ -157,7 +158,7 @@ class HybridProtocol(TS6Protocol): # we know what modes it supports (indeed, this is a standard list). # <- CAPAB :UNDLN UNKLN KLN TBURST KNOCK ENCAP DLN IE EX HOPS CHW SVS CLUSTER EOB QS self.irc.caps = caps = args[0].split() - for required_cap in ('EX', 'IE', 'SVS', 'EOB', 'HOPS', 'QS', 'TBURST', 'SVS'): + for required_cap in ('SVS', 'EOB', 'HOPS', 'QS', 'TBURST'): if required_cap not in caps: raise ProtocolError('%s not found in TS6 capabilities list; this is required! (got %r)' % (required_cap, caps)) From 0eb605219b7184db4a2df8bcd93dcaed3dcb9997 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 31 Aug 2017 15:14:47 -0700 Subject: [PATCH 6/6] conf: use splitext() to fetch the config name This fixes incorrect behaviour when there are multiple .'s in the config filename (e.g. '1.2.3.yml' got truncated to confname='1') --- conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.py b/conf.py index 85c0bdc..fdbb629 100644 --- a/conf.py +++ b/conf.py @@ -115,7 +115,7 @@ def loadConf(filename, errors_fatal=True, logger=None): # Note: store globally the last loaded conf filename, for REHASH in coremods/control. fname = filename # For the internal config name, strip off any .yml extensions and absolute paths - confname = os.path.basename(filename).split('.', 1)[0] + confname = os.path.splitext(os.path.basename(filename))[0] try: with open(filename, 'r') as f: conf = yaml.load(f)