summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2008-09-19 05:41:29 +0000
committerdjm <djm@openbsd.org>2008-09-19 05:41:29 +0000
commit5cf319380f40412ab3ab1bf97f98be0e06439c51 (patch)
tree110c6886462c4ec82cb1d6cd9aa23197430106cb
parentWhile vaguely interesting, the prints coming out of the driver was way too (diff)
downloadwireguard-openbsd-5cf319380f40412ab3ab1bf97f98be0e06439c51.tar.xz
wireguard-openbsd-5cf319380f40412ab3ab1bf97f98be0e06439c51.zip
increase MAXINTERP from 64 to 128 and allow a little extra room on top
of that for shell scripts to cover the #!, an optional space following it and a newline at the end. feedback and ok miod@
-rw-r--r--share/man/man7/script.78
-rw-r--r--sys/kern/exec_conf.c4
-rw-r--r--sys/sys/exec_script.h3
-rw-r--r--sys/sys/param.h4
4 files changed, 10 insertions, 9 deletions
diff --git a/share/man/man7/script.7 b/share/man/man7/script.7
index 563293459ea..8e59af16be1 100644
--- a/share/man/man7/script.7
+++ b/share/man/man7/script.7
@@ -1,4 +1,4 @@
-.\" $OpenBSD: script.7,v 1.5 2008/06/26 05:42:07 ray Exp $
+.\" $OpenBSD: script.7,v 1.6 2008/09/19 05:41:29 djm Exp $
.\"
.\" $NetBSD: script.7,v 1.1 2005/05/07 02:20:34 perry Exp $
.\"
@@ -29,7 +29,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 26 2008 $
+.Dd $Mdocdate: September 19 2008 $
.Dt SCRIPT 7
.Os
.Sh NAME
@@ -108,9 +108,9 @@ but there is no requirement for this per se.
.Pp
On
.Ox ,
-the length of the
+the length of the interpreter line following the
.Sq #!
-line is limited to
+is limited to
.Dv MAXINTERP ,
as defined in
.Aq Pa sys/param.h .
diff --git a/sys/kern/exec_conf.c b/sys/kern/exec_conf.c
index 0fdb744101d..8c86a3303a3 100644
--- a/sys/kern/exec_conf.c
+++ b/sys/kern/exec_conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_conf.c,v 1.18 2007/05/28 23:10:10 beck Exp $ */
+/* $OpenBSD: exec_conf.c,v 1.19 2008/09/19 05:41:29 djm Exp $ */
/* $NetBSD: exec_conf.c,v 1.16 1995/12/09 05:34:47 cgd Exp $ */
/*
@@ -81,7 +81,7 @@ extern struct emul emul_native, emul_elf32, emul_elf64, emul_aout,
emul_osf1, emul_sunos, emul_svr4, emul_ultrix;
struct execsw execsw[] = {
- { MAXINTERP, exec_script_makecmds, &emul_native, }, /* shell scripts */
+ { EXEC_SCRIPT_HDRSZ, exec_script_makecmds, &emul_native, }, /* shell scripts */
#ifdef _KERN_DO_AOUT
#ifdef COMPAT_AOUT
{ sizeof(struct exec), exec_aout_makecmds, &emul_aout },
diff --git a/sys/sys/exec_script.h b/sys/sys/exec_script.h
index ca85acf5b0f..ad3cf43b242 100644
--- a/sys/sys/exec_script.h
+++ b/sys/sys/exec_script.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_script.h,v 1.4 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: exec_script.h,v 1.5 2008/09/19 05:41:29 djm Exp $ */
/* $NetBSD: exec_script.h,v 1.6 1995/03/26 20:24:11 jtc Exp $ */
/*
@@ -33,6 +33,7 @@
#define EXEC_SCRIPT_MAGIC "#!"
#define EXEC_SCRIPT_MAGICLEN 2
+#define EXEC_SCRIPT_HDRSZ (EXEC_SCRIPT_MAGICLEN + 1 + MAXINTERP + 1)
#define SETUIDSCRIPTS /* they are secure, so enable them */
diff --git a/sys/sys/param.h b/sys/sys/param.h
index aa41220abf7..63baf82def3 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.75 2008/07/02 00:13:32 deraadt Exp $ */
+/* $OpenBSD: param.h,v 1.76 2008/09/19 05:41:29 djm Exp $ */
/* $NetBSD: param.h,v 1.23 1996/03/17 01:02:29 thorpej Exp $ */
/*-
@@ -67,7 +67,7 @@
#include <sys/syslimits.h>
#define MAXCOMLEN 16 /* max command name remembered */
-#define MAXINTERP 64 /* max interpreter file name length */
+#define MAXINTERP 128 /* max interpreter file name length */
#define MAXLOGNAME LOGIN_NAME_MAX /* max login name length w/ NUL */
#define MAXUPRC CHILD_MAX /* max simultaneous processes */
#define NCARGS ARG_MAX /* max bytes for an exec function */