mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Autologging: '/' -> '_' - don't even accidentally try to log to
#../../../file if you happen to join to such channel.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1009 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
634dfd41e8
commit
f61bde7d3c
@ -342,7 +342,7 @@ static void autologs_close_all(void)
|
||||
static void autolog_open(void *server, const char *target)
|
||||
{
|
||||
LOG_REC *log;
|
||||
char *fname, *dir;
|
||||
char *fname, *dir, *fixed_target;
|
||||
|
||||
log = logs_find_item(LOG_ITEM_TARGET, target, server, NULL);
|
||||
if (log != NULL && !log->failed) {
|
||||
@ -350,8 +350,14 @@ static void autolog_open(void *server, const char *target)
|
||||
return;
|
||||
}
|
||||
|
||||
/* '/' -> '_' - don't even accidentally try to log to
|
||||
#../../../file if you happen to join to such channel.. */
|
||||
fixed_target = g_strdup(target);
|
||||
replace_chars(fixed_target, '/', '_');
|
||||
fname = parse_special_string(autolog_path, server, NULL,
|
||||
target, NULL, 0);
|
||||
fixed_target, NULL, 0);
|
||||
g_free(fixed_target);
|
||||
|
||||
if (log_find(fname) == NULL) {
|
||||
log = log_create_rec(fname, autolog_level);
|
||||
log_item_add(log, LOG_ITEM_TARGET, target, server);
|
||||
|
Loading…
x
Reference in New Issue
Block a user