mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-10 21:23:12 +02:00
- 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).
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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; };
|
||||
|
||||
@@ -2064,6 +2064,8 @@ set {
|
||||
stats flags.</p>
|
||||
<p><font class="set">set::maxchannelsperuser <amount-of-channels>;</font><br>
|
||||
Specifies the number of channels a single user may be in at any one time.</p>
|
||||
<p><font class="set">set::maxdccallow <amount-of-entries>;</font><br>
|
||||
Specifies the maximum number of entries a user can have on his/her DCCALLOW list.</p>
|
||||
<p><font class="set">set::channel-command-prefix <command-prefixes>;</font><br>
|
||||
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
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
+14
-3
@@ -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);
|
||||
|
||||
+2
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user