]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix mod_event_list_set() to stop if failed to open()
authorJorge Pereira <jpereiran@gmail.com>
Tue, 3 Dec 2019 00:50:15 +0000 (21:50 -0300)
committerAlan DeKok <aland@freeradius.org>
Tue, 3 Dec 2019 14:19:10 +0000 (09:19 -0500)
If failed to open() the file, just report and stop it.

src/modules/proto_radius/proto_radius_load.c

index 9968853dd3caac2097aff9ba7520c706ed24739f..749d619af1f747fae5f608c8338af4659becce1e 100644 (file)
@@ -336,6 +336,7 @@ static void mod_event_list_set(fr_listen_t *li, fr_event_list_t *el, void *nr)
        thread->fd = open(inst->csv, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0600);
        if (thread->fd < 0) {
                ERROR("Failed opening %s - %s", inst->csv, fr_syserror(errno));
+               return;
        }
 
        (void) fr_event_timer_in(thread, thread->el, &thread->ev, NSEC, write_stats, thread);