Skip to content
Permalink
Browse files

Remove strict-host option

  • Loading branch information
vanosg committed Nov 27, 2019
1 parent 70ef597 commit 191079995ab0ff9cfcfde9f57f0351363ac745ff
@@ -484,12 +484,6 @@ Advanced Settings
dupwait-timeout seconds before it checks again and then finally
reject the bot.

set strict-host 1
Set this to 0 if you want the bot to strip '~+-^=' characters from
user@hosts before matching them. This setting is currently kept for
compatibility, but will be removed from the next release. Please leave
it set to 1 for now to avoid problems with your user files in the future.

set cidr-support 0
Enables cidr support for b/e/I modes if set to 1. This means the bot
will understand and match modes in cidr notation, and will be able to
@@ -586,13 +586,6 @@ set allow-dk-cmds 1
# seconds before it checks again and then finally reject the bot.
set dupwait-timeout 5

# Set this to 0 if you want the bot to strip '~+-^=' characters from user@hosts
# before matching them.
# This setting is currently kept for compatibility, but will be removed from
# the next release. Please leave it set to 1 to avoid problems with your user
# files in the future.
set strict-host 1

# Enable cidr support for b/e/I modes. This means the bot will understand
# and match modes in cidr notation, and will be able to put and enforce such
# bans or unban itself, if banned with a cidr mask.
@@ -249,14 +249,6 @@
### %bset share-unlinks%b 0/1
This setting prohibits remote bots from telling your Eggdrop to
unlink from share bots.
%{help=set strict-host}%{+n}
### %bset strict-host%b <0/1>
Specifies whether the bot should leave leading ~+-^= in users'
hostnames. If this is on, the bot will differentiate between
valid-ident usernames and invalid ones. This setting is currently
kept for compatibility, but will be removed from the next release.
Please leave it set to 1 for now to avoid problems with your user
files in the future.
%{help=set cidr-support}%{+n}
### %bset cidr-support%b <0/1>
Enables cidr support for b/e/I modes if set to 1. This means the
@@ -32,7 +32,7 @@ extern struct dcc_t *dcc;
extern struct userrec *userlist;
extern tcl_timer_t *timer, *utimer;
extern int dcc_total, remote_boots, backgrd, make_userfile, conmask, require_p,
must_be_owner, strict_host;
must_be_owner;
extern volatile sig_atomic_t do_restart;
extern unsigned long otraffic_irc, otraffic_irc_today, itraffic_irc,
itraffic_irc_today, otraffic_bn, otraffic_bn_today,
@@ -76,8 +76,7 @@ static int add_bot_hostmask(int idx, char *nick)
return 0;
}
if (strchr("~^+=-", m->userhost[0]))
egg_snprintf(s, sizeof s, "*!%s%s", strict_host ? "?" : "",
m->userhost + 1);
egg_snprintf(s, sizeof s, "*!?%s", m->userhost + 1);
else
egg_snprintf(s, sizeof s, "*!%s", m->userhost);
dprintf(idx, "(Added hostmask for %s from %s)\n", nick, chan->dname);
@@ -44,7 +44,7 @@ extern struct chanset_t *chanset;
extern char helpdir[], version[], origbotname[], botname[], admin[], network[],
motdfile[], ver[], botnetnick[], bannerfile[], textdir[];
extern int backgrd, con_chan, term_z, use_stderr, dcc_total, keep_all_logs,
quick_logs, strict_host;
quick_logs;

extern time_t now;
extern Tcl_Interp *interp;
@@ -860,7 +860,7 @@ static void check_this_user(char *hand, int delete, char *host)
sprintf(s, "%s!%s", m->nick, m->userhost);
u = m->user ? m->user : get_user_by_host(s);
if ((u && !strcasecmp(u->handle, hand) && delete < 2) ||
(!u && delete == 2 && match_addr(host, fixfrom(s)))) {
(!u && delete == 2 && match_addr(host, s))) {
u = delete ? NULL : u;
get_user_flagrec(u, &fr, chan->dname);
check_this_member(chan, m->nick, &fr);
@@ -1040,12 +1040,7 @@ static void cmd_adduser(struct userrec *u, int idx, char *par)
strlcpy(s1, s, sizeof s1);
p1 = strchr(s1, '!');
if (strchr("~^+=-", p1[1])) {
if (strict_host)
p1[1] = '?';
else {
p1[1] = '!';
p1++;
}
p1[1] = '?';
}
p1--;
p1[0] = '*';
@@ -121,7 +121,7 @@ See also: kickban, console
.kickban -nick *!*dent@host.name.domain
.kickban @nick *!*@host.name.domain

Or with a host of nick!~ident@host.name.domain (strict-host set to 1):
Or with a host of nick!~ident@host.name.domain:

Command Banmask
.kickban nick *!*ident@*.name.domain
@@ -219,8 +219,8 @@ See also: console, devoice
%bbounce-modes use-354 bounce-invites%b
%bmax-exempts max-modes bounce-exempts%b
%bmax-invites kick-method modes-per-line%b
%bno-chanrec-info ctcp-mode strict-host%b
%bkeep-nick include-lk prevent-mixing%b
%bno-chanrec-info ctcp-mode prevent-mixing%b
%bkeep-nick include-lk%b
(Use %b'.help set <variable>'%b for more info)
%{help=all}%{+o|o}
### %birc module%b commands
@@ -37,7 +37,6 @@ static p_tcl_bind_list H_nick, H_mode, H_kick, H_join, H_need;
static Function *global = NULL, *channels_funcs = NULL, *server_funcs = NULL;

static int ctcp_mode;
static int strict_host;
static int wait_split = 300; /* Time to wait for user to return from net-split. */
static int max_bans = 20; /* Modified by net-type 1-4 */
static int max_exempts = 20; /* Modified by net-type 1-4 */
@@ -932,7 +931,6 @@ static tcl_ints myints[] = {
{"max-exempts", &max_exempts, 0},
{"max-invites", &max_invites, 0},
{"max-modes", &max_modes, 0},
{"strict-host", &strict_host, 0}, /* arthur2 */
{"ctcp-mode", &ctcp_mode, 0}, /* arthur2 */
{"keep-nick", &keepnick, 0}, /* guppy */
{"prevent-mixing", &prevent_mixing, 0},
@@ -445,7 +445,7 @@
#define str_unescape ((void (*)(char *, const char))global[264])
#define egg_strcatn ((int (*)(char *dst, const char *src, size_t max))global[265])
#define clear_chanlist_member ((void (*)(const char *nick))global[266])
#define fixfrom ((char *(*)(char *))global[267])
/* was fixfrom */
/* 268 - 271 */
/* Please don't modify socklist directly, unless there's no other way.
* Its structure might be changed, or it might be completely removed,
@@ -542,7 +542,7 @@ Function global_table[] = {
(Function) str_unescape,
(Function) egg_strcatn,
(Function) clear_chanlist_member,
(Function) fixfrom,
(Function) 0, /* was fixfrom */
/* 268 - 271 */
(Function) & socklist, /* sock_list * */
(Function) sockoptions,
@@ -336,7 +336,6 @@ void write_userfile(int);
struct userrec *check_dcclist_hand(char *);
void touch_laston(struct userrec *, char *, time_t);
void user_del_chan(char *);
char *fixfrom(char *);
int check_conflags(struct flag_record *fr, int md);

/* users.c */
@@ -57,8 +57,7 @@ extern int flood_telnet_thr, flood_telnet_time, shtime, share_greet,
ignore_time, reserved_port_min, reserved_port_max, max_logs,
max_logsize, dcc_total, raw_log, identtimeout, dcc_sanitycheck,
dupwait_timeout, egg_numver, share_unlinks, protect_telnet,
strict_host, resolve_timeout, default_uflags, userfile_perm,
cidr_support;
resolve_timeout, default_uflags, userfile_perm, cidr_support;

#ifdef IPV6
extern char vhost6[];
@@ -447,7 +446,6 @@ static tcl_ints def_tcl_ints[] = {
{"quiet-save", &quiet_save, 0},
{"force-expire", &force_expire, 0},
{"dupwait-timeout", &dupwait_timeout, 0},
{"strict-host", &strict_host, 0},
{"userfile-perm", &userfile_perm, 0},
{"copy-to-tmp", &copy_to_tmp, 0},
{"quiet-reject", &quiet_reject, 0},
@@ -42,7 +42,6 @@ struct userrec *lastuser = NULL; /* last accessed user record */
maskrec *global_bans = NULL, *global_exempts = NULL, *global_invites = NULL;
struct igrec *global_ign = NULL;
int cache_hit = 0, cache_miss = 0; /* temporary cache accounting */
int strict_host = 1;
int userfile_perm = 0600; /* Userfile permissions
* (default rw-------) */
char userfile[121];
@@ -161,30 +160,6 @@ int count_users(struct userrec *bu)
return tot;
}

/* Removes a username prefix (~+-^=) from a userhost.
* e.g, "nick!~user@host" -> "nick!user@host"
*/
char *fixfrom(char *s)
{
static char uhost[UHOSTLEN];
char *p = uhost;

if (!s || !*s || strict_host)
return s;

while (*s) {
*p++ = *s;
if (*s == '!' && strchr("~+-^=", s[1]) && s[2] != '@') {
strcpy(p, s + 2);
return uhost;
}
s++;
}

*p = 0;
return uhost;
}

struct userrec *check_dcclist_hand(char *handle)
{
int i;
@@ -323,7 +298,6 @@ struct userrec *get_user_by_host(char *host)
}
cache_miss++;
strlcpy(host2, host, sizeof host2);
host = fixfrom(host);
for (u = userlist; u; u = u->next) {
q = get_user(&USERENTRY_HOSTS, u);
for (; q; q = q->next) {
@@ -656,13 +630,6 @@ struct userrec *adduser(struct userrec *bu, char *handle, char *host,
if (host && host[0]) {
char *p;

/* About this fixfrom():
* We should use this fixfrom before every call of adduser()
* but its much easier to use here... (drummer)
* Only use it if we have a host :) (dw)
*/
host = fixfrom(host);

p = strchr(host, ',');
while (p != NULL) {
*p = '?';

0 comments on commit 1910799

Please sign in to comment.
You can’t perform that action at this time.