summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKenneth Aafloy <devnull@localhost>2004-07-16 19:24:59 +0000
committerKenneth Aafloy <devnull@localhost>2004-07-16 19:24:59 +0000
commitd5f028c00f096f00133f1c3134919d2a31e4e95d (patch)
treec8e2937ea0359f975567dda468e95e6185775439 /linux
parent2848c66d0366df1880b673ecadbaefcbf1448a86 (diff)
downloadmediapointer-dvb-s2-d5f028c00f096f00133f1c3134919d2a31e4e95d.tar.gz
mediapointer-dvb-s2-d5f028c00f096f00133f1c3134919d2a31e4e95d.tar.bz2
- Do not allow write (and related) ioctls when frontend is opened RDONLY.
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_frontend.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
index 7748ba9b6..c68c57116 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -709,6 +709,11 @@ static int dvb_frontend_ioctl (struct inode *inode, struct file *file,
if (!fe || !fe->frontend.ioctl || fe->exit)
return -ENODEV;
+ if ((file->f_flags & O_ACCMODE) == O_RDONLY &&
+ (_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT ||
+ cmd == FE_DISEQC_RECV_SLAVE_REPLY))
+ return -EPERM;
+
if (down_interruptible (&fe->sem))
return -ERESTARTSYS;