summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-15 15:50:53 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-15 15:50:53 +0000
commit192004bf643733b63ea0a364ff8dde47cf368144 (patch)
tree33aa8244cfad78a587158403745371081ce70f0c /src/log.c
parent5b4129a89e9fa3ea3b5d57fc362f682aa85abfc7 (diff)
downloadconntrack-tools-192004bf643733b63ea0a364ff8dde47cf368144.tar.gz
conntrack-tools-192004bf643733b63ea0a364ff8dde47cf368144.zip
use umask() to set up file permissions
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/log.c b/src/log.c
index b42e049..35ae0c3 100644
--- a/src/log.c
+++ b/src/log.c
@@ -33,17 +33,7 @@
int init_log(void)
{
if (CONFIG(logfile)[0]) {
- int fd;
-
- fd = open(CONFIG(logfile), O_CREAT | O_RDWR, 0600);
- if (fd == -1) {
- fprintf(stderr, "ERROR: can't open logfile `%s'."
- "Reason: %s\n", CONFIG(logfile),
- strerror(errno));
- return -1;
- }
-
- STATE(log) = fdopen(fd, "a+");
+ STATE(log) = fopen(CONFIG(logfile), "a+");
if (STATE(log) == NULL) {
fprintf(stderr, "ERROR: can't open logfile `%s'."
"Reason: %s\n", CONFIG(logfile),
@@ -53,17 +43,7 @@ int init_log(void)
}
if (CONFIG(stats).logfile[0]) {
- int fd;
-
- fd = open(CONFIG(stats).logfile, O_CREAT | O_RDWR, 0600);
- if (fd == -1) {
- fprintf(stderr, "ERROR: can't open logfile `%s'."
- "Reason: %s\n", CONFIG(stats).logfile,
- strerror(errno));
- return -1;
- }
-
- STATE(stats_log) = fdopen(fd, "a+");
+ STATE(stats_log) = fopen(CONFIG(stats).logfile, "a+");
if (STATE(stats_log) == NULL) {
fprintf(stderr, "ERROR: can't open logfile `%s'."
"Reason: %s\n", CONFIG(stats).logfile,