Rename UMODE_SSLCLIENT, IsSSLClient
This commit is contained in:
parent
d1239f613f
commit
35eccf4930
8 changed files with 13 additions and 15 deletions
|
@ -48,7 +48,7 @@ h_can_join(hook_data_channel *data)
|
||||||
struct Client *source_p = data->client;
|
struct Client *source_p = data->client;
|
||||||
struct Channel *chptr = data->chptr;
|
struct Channel *chptr = data->chptr;
|
||||||
|
|
||||||
if(!(chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
|
if(!(chptr->mode.mode & mymode) && !IsSecureClient(source_p)) {
|
||||||
/* XXX This is equal to ERR_THROTTLE */
|
/* XXX This is equal to ERR_THROTTLE */
|
||||||
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (-U) - SSL/TLS required", chptr->chname);
|
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (-U) - SSL/TLS required", chptr->chname);
|
||||||
data->approved = ERR_CUSTOM;
|
data->approved = ERR_CUSTOM;
|
||||||
|
|
|
@ -46,7 +46,7 @@ h_can_join(hook_data_channel *data)
|
||||||
struct Client *source_p = data->client;
|
struct Client *source_p = data->client;
|
||||||
struct Channel *chptr = data->chptr;
|
struct Channel *chptr = data->chptr;
|
||||||
|
|
||||||
if((chptr->mode.mode & mymode) && !IsSSLClient(source_p)) {
|
if((chptr->mode.mode & mymode) && !IsSecureClient(source_p)) {
|
||||||
/* XXX This is equal to ERR_THROTTLE */
|
/* XXX This is equal to ERR_THROTTLE */
|
||||||
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (+S) - SSL/TLS required", chptr->chname);
|
sendto_one_numeric(source_p, 480, "%s :Cannot join channel (+S) - SSL/TLS required", chptr->chname);
|
||||||
data->approved = ERR_CUSTOM;
|
data->approved = ERR_CUSTOM;
|
||||||
|
|
|
@ -34,7 +34,7 @@ static int eb_ssl(const char *data, struct Client *client_p,
|
||||||
(void)chptr;
|
(void)chptr;
|
||||||
(void)mode_type;
|
(void)mode_type;
|
||||||
|
|
||||||
if (! IsSSLClient(client_p))
|
if (!IsSecureClient(client_p))
|
||||||
return EXTBAN_NOMATCH;
|
return EXTBAN_NOMATCH;
|
||||||
|
|
||||||
if (data != NULL)
|
if (data != NULL)
|
||||||
|
|
|
@ -453,7 +453,7 @@ struct ListClient
|
||||||
/* user information flags, only settable by remote mode or local oper */
|
/* user information flags, only settable by remote mode or local oper */
|
||||||
#define UMODE_OPER 0x1000 /* Operator */
|
#define UMODE_OPER 0x1000 /* Operator */
|
||||||
#define UMODE_ADMIN 0x2000 /* Admin on server */
|
#define UMODE_ADMIN 0x2000 /* Admin on server */
|
||||||
#define UMODE_SSLCLIENT 0x4000 /* using SSL */
|
#define UMODE_SECURE 0x4000 /* has a secure connection */
|
||||||
|
|
||||||
#define DEFAULT_OPER_UMODES (UMODE_SERVNOTICE | UMODE_OPERWALL | \
|
#define DEFAULT_OPER_UMODES (UMODE_SERVNOTICE | UMODE_OPERWALL | \
|
||||||
UMODE_WALLOP | UMODE_LOCOPS)
|
UMODE_WALLOP | UMODE_LOCOPS)
|
||||||
|
@ -527,16 +527,14 @@ struct ListClient
|
||||||
#define IsInvisible(x) ((x)->umodes & UMODE_INVISIBLE)
|
#define IsInvisible(x) ((x)->umodes & UMODE_INVISIBLE)
|
||||||
#define SetInvisible(x) ((x)->umodes |= UMODE_INVISIBLE)
|
#define SetInvisible(x) ((x)->umodes |= UMODE_INVISIBLE)
|
||||||
#define ClearInvisible(x) ((x)->umodes &= ~UMODE_INVISIBLE)
|
#define ClearInvisible(x) ((x)->umodes &= ~UMODE_INVISIBLE)
|
||||||
#define IsSSLClient(x) ((x)->umodes & UMODE_SSLCLIENT)
|
#define IsSecureClient(x) ((x)->umodes & UMODE_SECURE)
|
||||||
#define SetSSLClient(x) ((x)->umodes |= UMODE_SSLCLIENT)
|
|
||||||
#define ClearSSLClient(x) ((x)->umodes &= ~UMODE_SSLCLIENT)
|
|
||||||
#define SendWallops(x) ((x)->umodes & UMODE_WALLOP)
|
#define SendWallops(x) ((x)->umodes & UMODE_WALLOP)
|
||||||
#define SendLocops(x) ((x)->umodes & UMODE_LOCOPS)
|
#define SendLocops(x) ((x)->umodes & UMODE_LOCOPS)
|
||||||
#define SendServNotice(x) ((x)->umodes & UMODE_SERVNOTICE)
|
#define SendServNotice(x) ((x)->umodes & UMODE_SERVNOTICE)
|
||||||
#define SendOperwall(x) ((x)->umodes & UMODE_OPERWALL)
|
#define SendOperwall(x) ((x)->umodes & UMODE_OPERWALL)
|
||||||
#define IsService(x) ((x)->umodes & UMODE_SERVICE)
|
#define IsService(x) ((x)->umodes & UMODE_SERVICE)
|
||||||
#define IsDeaf(x) ((x)->umodes & UMODE_DEAF)
|
#define IsDeaf(x) ((x)->umodes & UMODE_DEAF)
|
||||||
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
||||||
|
|
||||||
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
|
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
|
||||||
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)
|
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)
|
||||||
|
|
|
@ -89,7 +89,7 @@ int user_modes[256] = {
|
||||||
0, /* W */
|
0, /* W */
|
||||||
0, /* X */
|
0, /* X */
|
||||||
0, /* Y */
|
0, /* Y */
|
||||||
UMODE_SSLCLIENT, /* Z */
|
UMODE_SECURE, /* Z */
|
||||||
/* 0x5B */ 0, 0, 0, 0, 0, 0, /* 0x60 */
|
/* 0x5B */ 0, 0, 0, 0, 0, 0, /* 0x60 */
|
||||||
UMODE_ADMIN, /* a */
|
UMODE_ADMIN, /* a */
|
||||||
0, /* b */
|
0, /* b */
|
||||||
|
@ -635,7 +635,7 @@ register_local_user(struct Client *client_p, struct Client *source_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsSecure(source_p))
|
if (IsSecure(source_p))
|
||||||
source_p->umodes |= UMODE_SSLCLIENT;
|
source_p->umodes |= UMODE_SECURE;
|
||||||
|
|
||||||
if (source_p->umodes & UMODE_INVISIBLE)
|
if (source_p->umodes & UMODE_INVISIBLE)
|
||||||
Count.invisi++;
|
Count.invisi++;
|
||||||
|
|
|
@ -222,7 +222,7 @@ m_challenge(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsOperConfNeedSSL(oper_p) && !IsSSLClient(source_p))
|
if(IsOperConfNeedSSL(oper_p) && !IsSecureClient(source_p))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(source_p, ERR_NOOPERHOST, form_str(ERR_NOOPERHOST));
|
sendto_one_numeric(source_p, ERR_NOOPERHOST, form_str(ERR_NOOPERHOST));
|
||||||
ilog(L_FOPER, "FAILED CHALLENGE (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
|
ilog(L_FOPER, "FAILED CHALLENGE (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
|
||||||
|
|
|
@ -101,7 +101,7 @@ m_oper(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsOperConfNeedSSL(oper_p) && !IsSSLClient(source_p))
|
if(IsOperConfNeedSSL(oper_p) && !IsSecureClient(source_p))
|
||||||
{
|
{
|
||||||
sendto_one_numeric(source_p, ERR_NOOPERHOST, form_str(ERR_NOOPERHOST));
|
sendto_one_numeric(source_p, ERR_NOOPERHOST, form_str(ERR_NOOPERHOST));
|
||||||
ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
|
ilog(L_FOPER, "FAILED OPER (%s) by (%s!%s@%s) (%s) -- requires SSL/TLS",
|
||||||
|
|
|
@ -337,7 +337,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
|
||||||
target_p->name, buf);
|
target_p->name, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsSSLClient(target_p))
|
if(IsSecureClient(target_p))
|
||||||
{
|
{
|
||||||
char cbuf[256] = "is using a secure connection";
|
char cbuf[256] = "is using a secure connection";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue