diff --git a/Changes b/Changes index 8ae318a3a..35e7ff756 100644 --- a/Changes +++ b/Changes @@ -3256,3 +3256,5 @@ This is the 3.2 fixes branch. 'safe types' (jpg, jpeg, png, gif, etc). Note that the purpose of this file is NOT to get a complete list, rather to limit it to a few 'known safe' entries. - Added set::maxdccallow: max number of entries of the DCCALLOW list (default: 10). +- Various (non-critical) fixes for dccallow reported by Rocko (incorrect nick in deny msg, + added set::maxdccallow in docs, added bmp/vob/log/ to dccallow.conf). diff --git a/dccallow.conf b/dccallow.conf index 6d1c0344d..2c248dd4c 100644 --- a/dccallow.conf +++ b/dccallow.conf @@ -23,6 +23,7 @@ allow dcc { filename "*.jpg"; soft yes; }; allow dcc { filename "*.jpeg"; soft yes; }; allow dcc { filename "*.gif"; soft yes; }; allow dcc { filename "*.png"; soft yes; }; +allow dcc { filename "*.bmp"; soft yes; }; /* audio / video (but not scripted/playlists!) */ allow dcc { filename "*.mp1"; soft yes; }; allow dcc { filename "*.mp2"; soft yes; }; @@ -31,11 +32,13 @@ allow dcc { filename "*.mpg"; soft yes; }; allow dcc { filename "*.mpeg"; soft yes; }; allow dcc { filename "*.m1v"; soft yes; }; allow dcc { filename "*.m2v"; soft yes; }; +allow dcc { filename "*.vob"; soft yes; }; allow dcc { filename "*.wav"; soft yes; }; allow dcc { filename "*.wma"; soft yes; }; allow dcc { filename "*.wmv"; soft yes; }; /* text / misc */ allow dcc { filename "*.txt"; soft yes; }; +allow dcc { filename "*.log"; soft yes; }; allow dcc { filename "*.pdf"; soft yes; }; allow dcc { filename "*.c"; soft yes; }; allow dcc { filename "*.cpp"; soft yes; }; diff --git a/doc/unreal32docs.html b/doc/unreal32docs.html index 78567c873..cea596787 100644 --- a/doc/unreal32docs.html +++ b/doc/unreal32docs.html @@ -2064,6 +2064,8 @@ set { stats flags.

set::maxchannelsperuser <amount-of-channels>;
Specifies the number of channels a single user may be in at any one time.

+

set::maxdccallow <amount-of-entries>;
+ Specifies the maximum number of entries a user can have on his/her DCCALLOW list.

set::channel-command-prefix <command-prefixes>;
Specifies the prefix characters for services "in channel commands". Messages starting with any of the specified characters will still be sent even if the client is +d. The default diff --git a/include/h.h b/include/h.h index 45091e04c..51dd22b17 100644 --- a/include/h.h +++ b/include/h.h @@ -329,8 +329,8 @@ extern unsigned char *StripColors(unsigned char *); extern const char *StripControlCodes(unsigned char *text); extern char *canonize(char *buffer); extern int webtv_parse(aClient *sptr, char *string); -extern ConfigItem_deny_dcc *dcc_isforbidden(aClient *sptr, aClient *target, char *filename); -extern ConfigItem_deny_dcc *dcc_isdiscouraged(aClient *sptr, aClient *target, char *filename); +extern ConfigItem_deny_dcc *dcc_isforbidden(aClient *sptr, char *filename); +extern ConfigItem_deny_dcc *dcc_isdiscouraged(aClient *sptr, char *filename); extern int check_registered(aClient *); extern int check_registered_user(aClient *); extern char *get_client_name(aClient *, int); diff --git a/src/modules/m_message.c b/src/modules/m_message.c index 4179b54fd..72273f919 100644 --- a/src/modules/m_message.c +++ b/src/modules/m_message.c @@ -775,7 +775,7 @@ int size_string, ret; if ((ret = dospamfilter(sptr, realfile, SPAMF_DCC, target)) < 0) return ret; - if ((fl = dcc_isforbidden(sptr, targetcli, realfile))) + if ((fl = dcc_isforbidden(sptr, realfile))) { char *displayfile = dcc_displayfile(realfile); sendto_one(sptr, @@ -793,6 +793,17 @@ int size_string, ret; sptr->flags |= FLAGS_DCCBLOCK; return 0; /* block */ } + + /* Channel dcc (???) and discouraged? just block */ + if (!targetcli && ((fl = dcc_isdiscouraged(sptr, realfile)))) + { + char *displayfile = dcc_displayfile(realfile); + sendto_one(sptr, + ":%s %d %s :*** Cannot DCC SEND file %s to %s (%s)", + me.name, RPL_TEXT, + sptr->name, displayfile, target, fl->reason); + return 0; /* block */ + } return 1; /* allowed */ } @@ -838,7 +849,7 @@ int size_string, ret; strlcpy(realfile, ctcp, size_string+1); - if ((fl = dcc_isdiscouraged(from, to, realfile))) + if ((fl = dcc_isdiscouraged(from, realfile))) { if (!on_dccallow_list(to, from)) { @@ -849,7 +860,7 @@ int size_string, ret; sendnotice(from, "User %s is currently not accepting DCC SENDs with such a filename/filetype from you. " "Your file %s was not sent.", to->name, displayfile); sendnotice(to, "%s (%s@%s) tried to DCC SEND you a file named '%s', the request has been blocked.", - to->name, to->user->username, GetHost(to), displayfile); + from->name, from->user->username, GetHost(from), displayfile); if (!IsDCCNotice(to)) { SetDCCNotice(to); diff --git a/src/s_extra.c b/src/s_extra.c index 7b676a03e..8e8fc1491 100644 --- a/src/s_extra.c +++ b/src/s_extra.c @@ -51,9 +51,8 @@ ID_Copyright("(C) Carsten Munk 1999"); */ /* checks if the dcc is blacklisted. - * NOTE: 'target' can be NULL if the target was a channel */ -ConfigItem_deny_dcc *dcc_isforbidden(aClient *sptr, aClient *target, char *filename) +ConfigItem_deny_dcc *dcc_isforbidden(aClient *sptr, char *filename) { ConfigItem_deny_dcc *d; ConfigItem_allow_dcc *a; @@ -78,9 +77,8 @@ ConfigItem_allow_dcc *a; } /* checks if the dcc is discouraged ('soft bans'). - * NOTE: 'target' can be NULL if the target was a channel */ -ConfigItem_deny_dcc *dcc_isdiscouraged(aClient *sptr, aClient *target, char *filename) +ConfigItem_deny_dcc *dcc_isdiscouraged(aClient *sptr, char *filename) { ConfigItem_deny_dcc *d; ConfigItem_allow_dcc *a;