From 7674ac43ca10034e1bfdbf283db75da7041ddb27 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 14 Apr 2007 14:23:40 +0100 Subject: Don't read channels.conf if it isn't a normal file or a link to a normal file. --- src/input/input_dvb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 6b975624e..a8598a001 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -77,6 +77,8 @@ #include #include #include +#include +#include #include #include #include @@ -888,11 +890,16 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch f = fopen(filename, "r"); if (!f) { - xprintf(xine, XINE_VERBOSITY_LOG, _("input_dvb: failed to open dvb channel file '%s'\n"), filename); + xprintf(xine, XINE_VERBOSITY_LOG, _("input_dvb: failed to open dvb channel file '%s': %s\n"), filename, strerror (errno)); if (!f && stream) _x_message(stream, XINE_MSG_FILE_NOT_FOUND, filename, "Please run the dvbscan utility.", NULL); return NULL; } + if (fstat (f, &st) || !S_ISREG (st.st_mode)) { + xprintf(xine, XINE_VERBOSITY_LOG, _("input_dvb: dvb channel file '%s' is not a plain file\n"), filename); + fclose(f); + return NULL; + } /* * load channel list -- cgit v1.2.3