summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2005-06-30 00:19:08 +0000
committerpeter <peter@FreeBSD.org>2005-06-30 00:19:08 +0000
commit2778435f72bb00f7b707c07e040cc72c341fe5c6 (patch)
treeb9325445859cb3fbd0000e9a1a52a91663ffc81c /sys/fs
parent2fdd4327e0a7ae2b93fb01da9aa76f1fec445038 (diff)
downloadFreeBSD-src-2778435f72bb00f7b707c07e040cc72c341fe5c6.zip
FreeBSD-src-2778435f72bb00f7b707c07e040cc72c341fe5c6.tar.gz
Conditionally weaken sys_generic.c rev 1.136 to allow certain dubious
ioctl numbers in backwards compatability mode. eg: an IOC_IN ioctl with a size of zero. Traditionally this was what you did before IOC_VOID existed, and we had some established users of this in the tree, namely procfs. Certain 3rd party drivers with binary userland components also have this too. This is necessary to have 4.x and 5.x binaries use these ioctl's. We found this at work when trying to run 4.x binaries. Approved by: re
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs_ioctl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/fs/procfs/procfs_ioctl.c b/sys/fs/procfs/procfs_ioctl.c
index 8b90da6..6ff00e7 100644
--- a/sys/fs/procfs/procfs_ioctl.c
+++ b/sys/fs/procfs/procfs_ioctl.c
@@ -28,6 +28,8 @@
* $FreeBSD$
*/
+#include "opt_compat.h"
+
#include <sys/param.h>
#include <sys/lock.h>
#include <sys/mutex.h>
@@ -51,12 +53,21 @@ procfs_ioctl(PFS_IOCTL_ARGS)
PROC_LOCK(p);
error = 0;
switch (cmd) {
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
+ case _IOC(IOC_IN, 'p', 1, 0):
+#endif
case PIOCBIS:
p->p_stops |= *(uintptr_t *)data;
break;
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
+ case _IOC(IOC_IN, 'p', 2, 0):
+#endif
case PIOCBIC:
p->p_stops &= ~*(uintptr_t *)data;
break;
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
+ case _IOC(IOC_IN, 'p', 3, 0):
+#endif
case PIOCSFL:
flags = *(uintptr_t *)data;
if (flags & PF_ISUGID && (error = suser(td)) != 0)
@@ -83,6 +94,9 @@ procfs_ioctl(PFS_IOCTL_ARGS)
ps->why = p->p_step ? p->p_stype : 0;
ps->val = p->p_step ? p->p_xstat : 0;
break;
+#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43)
+ case _IOC(IOC_IN, 'p', 5, 0):
+#endif
case PIOCCONT:
if (p->p_step == 0)
break;
OpenPOWER on IntegriCloud