diff options
author | Timo Sirainen <cras@irssi.org> | 2002-11-21 20:18:24 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-11-21 20:18:24 +0000 |
commit | ad27d4aac48968d6bafb119e572957378e794972 (patch) | |
tree | e2f2cc25313db73ce5a992639a54c97bcd7f04ad /src/core | |
parent | ecff491e025b25261680b83a24f7b934fd36eb4f (diff) | |
download | irssi-ad27d4aac48968d6bafb119e572957378e794972.zip |
Create log file directories using /set log_create_file_mode + exec-bit.
Patch by Noah Levitt <nlevitt at columbia.edu>
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3022 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/log.c | 8 | ||||
-rw-r--r-- | src/core/log.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/core/log.c b/src/core/log.c index e17f5c56..75768601 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -47,6 +47,7 @@ static const char *log_item_types[] = { const char *log_timestamp; static int log_file_create_mode; +static int log_dir_create_mode; static int rotate_tag; static int log_item_str2type(const char *type) @@ -116,7 +117,7 @@ int log_start_logging(LOG_REC *log) /* path may contain variables (%time, $vars), make sure the directory is created */ dir = g_dirname(log->real_fname); - mkpath(dir, LOG_DIR_CREATE_MODE); + mkpath(dir, log_dir_create_mode); g_free(dir); } @@ -557,6 +558,11 @@ static void read_settings(void) { log_timestamp = settings_get_str("log_timestamp"); log_file_create_mode = octal2dec(settings_get_int("log_create_mode")); + + log_dir_create_mode = log_file_create_mode; + if (log_file_create_mode & 0400) log_dir_create_mode |= 0100; + if (log_file_create_mode & 0040) log_dir_create_mode |= 0010; + if (log_file_create_mode & 0004) log_dir_create_mode |= 0001; } void log_init(void) diff --git a/src/core/log.h b/src/core/log.h index da97fb2c..fae872c7 100644 --- a/src/core/log.h +++ b/src/core/log.h @@ -1,8 +1,6 @@ #ifndef __LOG_H #define __LOG_H -#define LOG_DIR_CREATE_MODE 0700 - enum { LOG_ITEM_TARGET, /* channel, query, .. */ LOG_ITEM_WINDOW_REFNUM |