projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added Channel Mode +S (SSL): Only allow SSL Users joining the channel
[ircu2.10.12-pk.git]
/
ircd
/
m_relay.c
diff --git
a/ircd/m_relay.c
b/ircd/m_relay.c
index 3a02764832873307f5d655b0adf0af69e319a884..2bfb142da4b69c3c3180c94b75f57c3e5b51d98b 100644
(file)
--- a/
ircd/m_relay.c
+++ b/
ircd/m_relay.c
@@
-39,9
+39,9
@@
static void loc_handler_LR(const char *num, char *parv[], signed int parc) {
static void loc_handler_LA(const char *num, char *parv[], signed int parc) {
if(num[0] != '!' || parc < 1) return;
char *fakehost = NULL;
static void loc_handler_LA(const char *num, char *parv[], signed int parc) {
if(num[0] != '!' || parc < 1) return;
char *fakehost = NULL;
- if (parc > 1 &&
parv[1] != "0")
+ if (parc > 1 &&
strcmp(parv[1], "0") != 0) // 0 = no fakehost
fakehost=parv[1];
fakehost=parv[1];
-
+
if(parc > 2)
auth_loc_reply(&num[3], parv[0], fakehost, &parv[2] , parc - 2);
else if(parc > 1)
if(parc > 2)
auth_loc_reply(&num[3], parv[0], fakehost, &parv[2] , parc - 2);
else if(parc > 1)
@@
-78,17
+78,21
@@
static void mode_a_join(struct Client* cptr, char *channel, int flags) {
}
static void mode_a_check_altchan(struct Client* sptr, char *channel) {
}
static void mode_a_check_altchan(struct Client* sptr, char *channel) {
- st
atic
Channel *chptrb;
+ st
ruct
Channel *chptrb;
if (!(chptrb = FindChannel(channel))) {
if (!(chptrb = FindChannel(channel))) {
- if (((channel[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS)) || strlen(
altchan
) > IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN))) {
+ if (((channel[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS)) || strlen(
channel
) > IRCD_MIN(CHANNELLEN, feature_int(FEAT_CHANNELLEN))) {
//we don't send an error message here - that would be very strange for the user, because they normaly don't know that mode +F is set
//we don't send an error message here - that would be very strange for the user, because they normaly don't know that mode +F is set
- } else if ((chptrb = get_channel(sptr, altchan, CGT_CREATE))) {
+ } else if ((chptrb = get_channel(sptr, channel, CGT_CREATE))) {
+ struct JoinBuf create;
+ joinbuf_init(&create, sptr, sptr, JOINBUF_TYPE_CREATE, 0, TStime());
joinbuf_join(&create, chptrb, CHFL_CHANOP | CHFL_CHANNEL_MANAGER);
do_names(sptr, chptrb, NAMES_ALL|NAMES_EON);
joinbuf_join(&create, chptrb, CHFL_CHANOP | CHFL_CHANNEL_MANAGER);
do_names(sptr, chptrb, NAMES_ALL|NAMES_EON);
+ joinbuf_flush(&create);
}
} else {
//first of all check if we may even join this channel
int err2 = 0;
}
} else {
//first of all check if we may even join this channel
int err2 = 0;
+ int flags = 0;
if (chptrb->users == 0 && !chptrb->mode.apass[0] && !(chptrb->mode.mode & MODE_PERSIST)) {
/* Joining a zombie channel (zannel): give ops and increment TS. */
flags = CHFL_CHANOP;
if (chptrb->users == 0 && !chptrb->mode.apass[0] && !(chptrb->mode.mode & MODE_PERSIST)) {
/* Joining a zombie channel (zannel): give ops and increment TS. */
flags = CHFL_CHANOP;
@@
-101,11
+105,15
@@
static void mode_a_check_altchan(struct Client* sptr, char *channel) {
err2 = ERR_CHANNELISFULL;
else if ((chptrb->mode.mode & MODE_REGONLY) && !IsAccount(sptr))
err2 = ERR_NEEDREGGEDNICK;
err2 = ERR_CHANNELISFULL;
else if ((chptrb->mode.mode & MODE_REGONLY) && !IsAccount(sptr))
err2 = ERR_NEEDREGGEDNICK;
+ else if ((chptrb->mode.mode & MODE_SSLCHAN) && !IsSSL(sptr))
+ err2 = ERR_SSLCHANNEL;
else if (find_ban(sptr, chptrb->banlist))
err2 = ERR_BANNEDFROMCHAN;
else if (find_ban(sptr, chptrb->banlist))
err2 = ERR_BANNEDFROMCHAN;
- else if (*chptrb->mode.key
&& (!key || strcmp(key, chptrb->mode.key)))
+ else if (*chptrb->mode.key
) //Fix this!
err2 = ERR_BADCHANNELKEY;
if(!err2) {
err2 = ERR_BADCHANNELKEY;
if(!err2) {
+ struct JoinBuf join;
+ joinbuf_init(&join, sptr, sptr, JOINBUF_TYPE_JOIN, 0, 0);
joinbuf_join(&join, chptrb, flags);
del_invite(sptr, chptrb);
if (chptrb->topic[0]) {
joinbuf_join(&join, chptrb, flags);
del_invite(sptr, chptrb);
if (chptrb->topic[0]) {
@@
-113,6
+121,7
@@
static void mode_a_check_altchan(struct Client* sptr, char *channel) {
send_reply(sptr, RPL_TOPICWHOTIME, chptrb->chname, chptrb->topic_nick, chptrb->topic_time);
}
do_names(sptr, chptrb, NAMES_ALL|NAMES_EON); /* send /names list */
send_reply(sptr, RPL_TOPICWHOTIME, chptrb->chname, chptrb->topic_nick, chptrb->topic_time);
}
do_names(sptr, chptrb, NAMES_ALL|NAMES_EON); /* send /names list */
+ joinbuf_flush(&join);
}
}
}
}
}
}
@@
-223,10
+232,12
@@
signed int ms_relay(struct Client* cptr, struct Client* sptr, signed int parc, c
struct Client *acptr;
struct Channel *chptr;
if(acptr = findNUser(parv[1])) {
struct Client *acptr;
struct Channel *chptr;
if(acptr = findNUser(parv[1])) {
- if(chptr = FindChannel(parv[3]) && chptr->mode.altchan && IsChannelName(chptr->mode.altchan) && strIsIrcCh(chptr->mode.altchan)) {
+ if(IsChannelName(parv[3]) && strIsIrcCh(parv[3]) &&
+ (chptr = FindChannel(parv[3])) && chptr->mode.altchan &&
+ IsChannelName(chptr->mode.altchan) && strIsIrcCh(chptr->mode.altchan)) {
mode_a_check_altchan(acptr,chptr->mode.altchan);
}
mode_a_check_altchan(acptr,chptr->mode.altchan);
}
- send_reply(acptr, ERR_JOINACCESS, parv[3]);
+ send_reply(acptr, ERR_JOINACCESS, parv[3]
, feature_str(FEAT_ERR_JOINACCESS)
);
}
}
}
}