Apply by doing
cd /sys/compat/svr4
patch -p0 < compat_linux.patch
And then rebuild your kernel.
Index: svr4_misc.c
===================================================================
RCS file: /cvs/src/sys/compat/svr4/svr4_misc.c,v
retrieving revision 1.13
diff -u -r1.13 svr4_misc.c
--- svr4_misc.c 1997/10/06 20:19:35 1.13
+++ svr4_misc.c 1998/01/03 06:41:23
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_misc.c,v 1.13 1997/10/06 20:19:35 deraadt Exp $ */
+/* $OpenBSD: svr4_misc.c,v 1.18 1997/12/02 00:07:04 deraadt Exp $ */
/* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */
/*
@@ -48,6 +48,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
+#include <sys/ktrace.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/resource.h>
@@ -742,7 +743,7 @@
return 0;
default:
- return ENOSYS;
+ return EINVAL;
}
}
@@ -1284,6 +1285,18 @@
}
int
+svr4_sys_auditsys(p, v, retval)
+ register struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ /*
+ * XXX: Big brother is *not* watching.
+ */
+ return 0;
+}
+
+int
svr4_sys_memcntl(p, v, retval)
register struct proc *p;
void *v;
@@ -1321,4 +1334,38 @@
return error;
return 0;
+}
+
+/* ARGSUSED */
+int
+svr4_sys_setegid(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct sys_setegid_args /* {
+ syscallarg(gid_t) egid;
+ } */ *uap = v;
+
+#if defined(COMPAT_LINUX) && defined(i386)
+ if (SCARG(uap, egid) > 60000) {
+ /*
+ * One great fuckup deserves another. The Linux people
+ * made this their personality system call. But we can't
+ * tell if a binary is SVR4 or Linux until they do that
+ * system call, in some cases. So when we get it, and the
+ * value is out of some magical range, switch to Linux
+ * emulation and pray.
+ */
+ extern struct emul emul_linux_elf;
+
+ p->p_emul = &emul_linux_elf;
+#ifdef KTRACE
+ if (KTRPOINT(p, KTR_EMUL))
+ ktremul(p->p_tracep, p->p_emul->e_name);
+#endif
+ return (0);
+ }
+#endif
+ return sys_setegid(p, v, retval);
}
Index: svr4_syscall.h
===================================================================
RCS file: /cvs/src/sys/compat/svr4/svr4_syscall.h,v
retrieving revision 1.19
diff -u -r1.19 svr4_syscall.h
--- svr4_syscall.h 1997/08/29 20:45:26 1.19
+++ svr4_syscall.h 1998/01/03 06:36:01
@@ -2,7 +2,7 @@
* System call numbers.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.18 1997/08/29 20:44:26 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.21 1997/12/09 10:59:50 deraadt Exp
*/
#define SVR4_SYS_syscall 0
@@ -123,6 +123,7 @@
#define SVR4_SYS_pread 173
#define SVR4_SYS_pwrite 174
#define SVR4_SYS_acl 185
+#define SVR4_SYS_auditsys 186
#define SVR4_SYS_clock_gettime 191
#define SVR4_SYS_clock_settime 192
#define SVR4_SYS_clock_getres 193
Index: svr4_syscallargs.h
===================================================================
RCS file: /cvs/src/sys/compat/svr4/svr4_syscallargs.h,v
retrieving revision 1.19
diff -u -r1.19 svr4_syscallargs.h
--- svr4_syscallargs.h 1997/08/29 20:45:26 1.19
+++ svr4_syscallargs.h 1998/01/03 06:36:01
@@ -2,7 +2,7 @@
* System call argument lists.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.18 1997/08/29 20:44:26 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.21 1997/12/09 10:59:50 deraadt Exp
*/
#define syscallarg(x) union { x datum; register_t pad; }
@@ -296,6 +296,10 @@
syscallarg(int) dummy;
};
+struct svr4_sys_setegid_args {
+ syscallarg(gid_t) egid;
+};
+
struct svr4_sys_sysconfig_args {
syscallarg(int) name;
};
@@ -340,6 +344,15 @@
syscallarg(struct svr4_aclent *) buf;
};
+struct svr4_sys_auditsys_args {
+ syscallarg(int) code;
+ syscallarg(int) a1;
+ syscallarg(int) a2;
+ syscallarg(int) a3;
+ syscallarg(int) a4;
+ syscallarg(int) a5;
+};
+
struct svr4_sys_facl_args {
syscallarg(int) fd;
syscallarg(int) cmd;
@@ -463,7 +476,7 @@
int svr4_sys_memcntl __P((struct proc *, void *, register_t *));
int sys_rename __P((struct proc *, void *, register_t *));
int svr4_sys_uname __P((struct proc *, void *, register_t *));
-int sys_setegid __P((struct proc *, void *, register_t *));
+int svr4_sys_setegid __P((struct proc *, void *, register_t *));
int svr4_sys_sysconfig __P((struct proc *, void *, register_t *));
int sys_adjtime __P((struct proc *, void *, register_t *));
int svr4_sys_systeminfo __P((struct proc *, void *, register_t *));
@@ -477,6 +490,7 @@
int svr4_sys_pread __P((struct proc *, void *, register_t *));
int svr4_sys_pwrite __P((struct proc *, void *, register_t *));
int svr4_sys_acl __P((struct proc *, void *, register_t *));
+int svr4_sys_auditsys __P((struct proc *, void *, register_t *));
int sys_clock_gettime __P((struct proc *, void *, register_t *));
int sys_clock_settime __P((struct proc *, void *, register_t *));
int sys_clock_getres __P((struct proc *, void *, register_t *));
Index: svr4_syscalls.c
===================================================================
RCS file: /cvs/src/sys/compat/svr4/svr4_syscalls.c,v
retrieving revision 1.19
diff -u -r1.19 svr4_syscalls.c
--- svr4_syscalls.c 1997/08/29 20:45:27 1.19
+++ svr4_syscalls.c 1998/01/03 06:36:01
@@ -2,7 +2,7 @@
* System call names.
*
* DO NOT EDIT-- this file is automatically generated.
- * created from OpenBSD: syscalls.master,v 1.18 1997/08/29 20:44:26 kstailey Exp
+ * created from OpenBSD: syscalls.master,v 1.21 1997/12/09 10:59:50 deraadt Exp
*/
char *svr4_syscallnames[] = {
@@ -208,7 +208,7 @@
"#183 (unimplemented)", /* 183 = unimplemented */
"#184 (unimplemented tsolsys)", /* 184 = unimplemented tsolsys */
"acl", /* 185 = acl */
- "#186 (unimplemented auditsys)", /* 186 = unimplemented auditsys */
+ "auditsys", /* 186 = auditsys */
"#187 (unimplemented processor_bind)", /* 187 = unimplemented processor_bind */
"#188 (unimplemented processor_info)", /* 188 = unimplemented processor_info */
"#189 (unimplemented p_online)", /* 189 = unimplemented p_online */
Index: syscalls.master
===================================================================
RCS file: /cvs/src/sys/compat/svr4/syscalls.master,v
retrieving revision 1.18
diff -u -r1.18 syscalls.master
--- syscalls.master 1997/08/29 20:44:26 1.18
+++ syscalls.master 1998/01/03 06:36:01
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.18 1997/08/29 20:44:26 kstailey Exp $
+ $OpenBSD: syscalls.master,v 1.21 1997/12/09 10:59:50 deraadt Exp $
; $NetBSD: syscalls.master,v 1.17 1996/02/10 17:12:51 christos Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -234,7 +234,7 @@
134 NOARGS { int sys_rename(char *from, char *to); }
135 STD { int svr4_sys_uname(struct svr4_utsname* name, \
int dummy); }
-136 NOARGS { int sys_setegid(gid_t egid); }
+136 STD { int svr4_sys_setegid(gid_t egid); }
137 STD { int svr4_sys_sysconfig(int name); }
138 NOARGS { int sys_adjtime(struct timeval *delta, \
struct timeval *olddelta); }
@@ -292,7 +292,8 @@
184 UNIMPL tsolsys
185 STD { int svr4_sys_acl(char *path, int cmd, int num, \
struct svr4_aclent *buf); }
-186 UNIMPL auditsys
+186 STD { int svr4_sys_auditsys(int code, int a1, int a2, \
+ int a3, int a4, int a5); }
187 UNIMPL processor_bind
188 UNIMPL processor_info
189 UNIMPL p_online