summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2007-04-14 14:23:40 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2007-04-14 14:23:40 +0100
commit7674ac43ca10034e1bfdbf283db75da7041ddb27 (patch)
tree0fbc5b3628178b454676aa3f8e6bcca908bfddbc /src
parent547024e5bbe2294df9528738975230aca8aa8394 (diff)
downloadxine-lib-7674ac43ca10034e1bfdbf283db75da7041ddb27.tar.gz
xine-lib-7674ac43ca10034e1bfdbf283db75da7041ddb27.tar.bz2
Don't read channels.conf if it isn't a normal file or a link to a normal file.
Diffstat (limited to 'src')
-rw-r--r--src/input/input_dvb.c9
1 files changed, 8 insertions, 1 deletions
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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
@@ -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