1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 14:53:12 +02:00

Rename PLAINTEXT_POLICY_* to POLICY_ (and similarly, the struct, etc)

This commit is contained in:
Bram Matthys
2019-01-11 13:21:59 +01:00
parent a1d2698ead
commit 5fd673d059
10 changed files with 47 additions and 47 deletions
+3 -3
View File
@@ -57,9 +57,9 @@ char *plaintext_policy_capability_parameter(aClient *acptr)
static char buf[128];
snprintf(buf, sizeof(buf), "user=%s,oper=%s,server=%s",
plaintextpolicy_valtostr(iConf.plaintext_policy_user),
plaintextpolicy_valtostr(iConf.plaintext_policy_oper),
plaintextpolicy_valtostr(iConf.plaintext_policy_server));
policy_valtostr(iConf.plaintext_policy_user),
policy_valtostr(iConf.plaintext_policy_oper),
policy_valtostr(iConf.plaintext_policy_server));
return buf;
}
+2 -2
View File
@@ -1576,7 +1576,7 @@ int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, cha
sendto_one(sptr, rpl_str(RPL_SNOMASK),
me.name, sptr->name, get_snostr(user->snomask));
if (!IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_user == PLAINTEXT_POLICY_WARN))
if (!IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_user == POLICY_WARN))
sendnotice(sptr, "%s", iConf.plaintext_policy_user_message);
/* Make creation time the real 'online since' time, excluding registration time.
@@ -1692,7 +1692,7 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
static char uhost[HOSTLEN + USERLEN + 3];
static char fullname[HOSTLEN + 1];
if (!IsSecure(cptr) && !IsLocal(cptr) && (iConf.plaintext_policy_user == PLAINTEXT_POLICY_DENY))
if (!IsSecure(cptr) && !IsLocal(cptr) && (iConf.plaintext_policy_user == POLICY_DENY))
{
return exit_client(cptr, cptr, &me, iConf.plaintext_policy_user_message);
}
+2 -2
View File
@@ -114,7 +114,7 @@ CMD_FUNC(m_oper)
name = parv[1];
password = (parc > 2) ? parv[2] : "";
if (!IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_oper == PLAINTEXT_POLICY_DENY))
if (!IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_oper == POLICY_DENY))
{
/* Reject early */
sendnotice(sptr, "%s", iConf.plaintext_policy_oper_message);
@@ -304,7 +304,7 @@ CMD_FUNC(m_oper)
return FLUSH_BUFFER;
}
if (!IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_oper == PLAINTEXT_POLICY_WARN))
if (!IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_oper == POLICY_WARN))
{
sendnotice(sptr, "%s", iConf.plaintext_policy_oper_message);
sendto_snomask_global
+1 -1
View File
@@ -312,7 +312,7 @@ int sasl_capability_visible(aClient *sptr)
if (!SASL_SERVER || !find_server(SASL_SERVER, NULL))
return 0;
if (sptr && !IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_user == PLAINTEXT_POLICY_DENY))
if (sptr && !IsSecure(sptr) && !IsLocal(sptr) && (iConf.plaintext_policy_user == POLICY_DENY))
return 0;
return 1;
+2 -2
View File
@@ -400,7 +400,7 @@ skip_host_check:
get_client_name(cptr, TRUE));
return exit_client(cptr, cptr, &me, "Full class");
}
if (!IsLocal(cptr) && (iConf.plaintext_policy_server == PLAINTEXT_POLICY_DENY) && !IsSecure(cptr))
if (!IsLocal(cptr) && (iConf.plaintext_policy_server == POLICY_DENY) && !IsSecure(cptr))
{
sendto_one(cptr, "ERROR :Servers need to use SSL/TLS (set::plaintext-policy::server is 'deny')");
sendto_ops_and_log("Rejected insecure server %s. See https://www.unrealircd.org/docs/FAQ#ERROR:_Servers_need_to_use_SSL.2FTLS", cptr->name);
@@ -867,7 +867,7 @@ int m_server_synch(aClient *cptr, ConfigItem_link *aconf)
* Yeah.. there are still other cases when non-SSL links are fine (eg: local IP
* of the same machine), we won't bother with detecting that. -- Syzop
*/
if (!IsLocal(cptr) && (iConf.plaintext_policy_server == PLAINTEXT_POLICY_WARN))
if (!IsLocal(cptr) && (iConf.plaintext_policy_server == POLICY_WARN))
{
sendto_realops("\002WARNING:\002 This link is unencrypted (non-SSL). We highly recommend to use "
"SSL server linking. See https://www.unrealircd.org/docs/Linking_servers");
+3 -3
View File
@@ -1320,11 +1320,11 @@ int stats_set(aClient *sptr, char *para)
sendto_one(sptr, ":%s %i %s :check-target-nick-bans: %s", me.name, RPL_TEXT,
sptr->name, CHECK_TARGET_NICK_BANS ? "yes" : "no");
sendto_one(sptr, ":%s %i %s :plaintext-policy::user: %s", me.name, RPL_TEXT,
sptr->name, plaintextpolicy_valtostr(iConf.plaintext_policy_user));
sptr->name, policy_valtostr(iConf.plaintext_policy_user));
sendto_one(sptr, ":%s %i %s :plaintext-policy::oper: %s", me.name, RPL_TEXT,
sptr->name, plaintextpolicy_valtostr(iConf.plaintext_policy_oper));
sptr->name, policy_valtostr(iConf.plaintext_policy_oper));
sendto_one(sptr, ":%s %i %s :plaintext-policy::server: %s", me.name, RPL_TEXT,
sptr->name, plaintextpolicy_valtostr(iConf.plaintext_policy_server));
sptr->name, policy_valtostr(iConf.plaintext_policy_server));
RunHook2(HOOKTYPE_STATS, sptr, "S");
return 1;
}