1
0
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:
Bram Matthys
2004-06-10 15:53:13 +00:00
parent fe89b2e36b
commit 47f3c43295
6 changed files with 25 additions and 9 deletions
+2
View File
@@ -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).
+3
View File
@@ -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; };
+2
View File
@@ -2064,6 +2064,8 @@ set {
stats flags.</p>
<p><font class="set">set::maxchannelsperuser &lt;amount-of-channels&gt;;</font><br>
Specifies the number of channels a single user may be in at any one time.</p>
<p><font class="set">set::maxdccallow &lt;amount-of-entries&gt;;</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 &lt;command-prefixes&gt;;</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
View File
@@ -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
View File
@@ -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
View File
@@ -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;