Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] [PATCH] Fix Frontend RO Ioctl's



Hi!

I've attached a patch that will prevent programs from setting the frontend 
when the device is opened with O_RDONLY. I can't see how this could break 
applications, but you never know what strange things some people do :)
If nobody objects to this change, I'll commit it in a few days.

Kenneth
Index: dvb_frontend.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_frontend.c,v
retrieving revision 1.80
diff -u -r1.80 dvb_frontend.c
--- dvb_frontend.c	14 May 2004 09:55:27 -0000	1.80
+++ dvb_frontend.c	9 Jul 2004 19:26:32 -0000
@@ -706,6 +706,11 @@
 
 	dprintk ("%s\n", __FUNCTION__);
 
+	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 (!fe || !fe->frontend.ioctl || fe->exit)
 		return -ENODEV;
 

Home | Main Index | Thread Index