diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2016-06-05 14:43:34 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-07-21 20:59:35 +0100 |
commit | e9166ea294055c5cc510de2b05ed05056f05ed36 (patch) | |
tree | 82fbaa918b023e7eb7503dddc482ce8b6c21b7d7 | |
parent | a8305cde195225a2ca7b3384cb4c2d1290ed0867 (diff) |
Add CERTFP capability
Avoid sending CERTFP commands to servers which do not support this
by adding a CERTFP capability.
-rw-r--r-- | include/s_serv.h | 1 | ||||
-rw-r--r-- | modules/core/m_server.c | 2 | ||||
-rw-r--r-- | modules/m_certfp.c | 4 | ||||
-rw-r--r-- | src/ircd.c | 1 | ||||
-rw-r--r-- | src/s_user.c | 2 |
5 files changed, 6 insertions, 4 deletions
diff --git a/include/s_serv.h b/include/s_serv.h index 57fa865..b2c5cb7 100644 --- a/include/s_serv.h +++ b/include/s_serv.h @@ -67,6 +67,7 @@ struct Capability #define CAP_DLN 0x00008000 /* Can do DLINE message */ #define CAP_UNDLN 0x00010000 /* Can do UNDLINE message */ #define CAP_CHW 0x00020000 /* Can do channel wall @# */ +#define CAP_CERTFP 0x00040000 /* supports CERTFP */ /* * Capability macros. diff --git a/modules/core/m_server.c b/modules/core/m_server.c index 2e0ed8d..7cd9ae2 100644 --- a/modules/core/m_server.c +++ b/modules/core/m_server.c @@ -104,7 +104,7 @@ sendnick_TS(struct Client *client_p, struct Client *target_p) target_p->servptr->name, target_p->info); } - if (!EmptyString(target_p->certfp)) + if (!EmptyString(target_p->certfp) && IsCapable(client_p, CAP_CERTFP)) sendto_one(client_p, ":%s CERTFP %s", ID_or_name(target_p, client_p), target_p->certfp); diff --git a/modules/m_certfp.c b/modules/m_certfp.c index e52f9f5..359a651 100644 --- a/modules/m_certfp.c +++ b/modules/m_certfp.c @@ -58,9 +58,9 @@ ms_certfp(struct Client *client_p, struct Client *source_p, MyFree(source_p->certfp); source_p->certfp = strdup(parv[1]); - sendto_server(client_p, CAP_TS6, NOCAPS, ":%s CERTFP %s", + sendto_server(client_p, CAP_TS6 | CAP_CERTFP, NOCAPS, ":%s CERTFP %s", ID(source_p), parv[1]); - sendto_server(client_p, NOCAPS, CAP_TS6, ":%s CERTFP %s", + sendto_server(client_p, CAP_CERTFP, CAP_TS6, ":%s CERTFP %s", source_p->name, parv[1]); return 0; } @@ -312,6 +312,7 @@ initialize_server_capabs(void) #ifdef HALFOPS add_capability("HOPS", CAP_HOPS, 1); #endif + add_capability("CERTFP", CAP_CERTFP, 1); } /* write_pidfile() diff --git a/src/s_user.c b/src/s_user.c index 9e861a4..9cf2aa9 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -650,7 +650,7 @@ introduce_client(struct Client *source_p) source_p->servptr->name, source_p->info); } - if (!EmptyString(source_p->certfp)) + if (!EmptyString(source_p->certfp) && IsCapable(server, CAP_CERTFP)) sendto_one(server, ":%s CERTFP %s", ID(source_p), source_p->certfp); } } |