grow #! line length -- patch from cgd, fixes PR kern/20112 from Todd Vierling
This commit is contained in:
parent
71cdc2eb5e
commit
a6e07c4e35
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec_conf.c,v 1.79 2003/02/19 09:44:42 jdolecek Exp $ */
|
||||
/* $NetBSD: exec_conf.c,v 1.80 2003/04/02 01:00:19 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994 Christopher G. Demetriou
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: exec_conf.c,v 1.79 2003/02/19 09:44:42 jdolecek Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: exec_conf.c,v 1.80 2003/04/02 01:00:19 perry Exp $");
|
||||
|
||||
#include "opt_execfmt.h"
|
||||
#include "opt_compat_freebsd.h"
|
||||
@ -189,7 +189,7 @@ extern const struct emul emul_netbsd_aoutm68k;
|
||||
const struct execsw execsw_builtin[] = {
|
||||
#ifdef EXEC_SCRIPT
|
||||
/* Shell scripts */
|
||||
{ MAXINTERP,
|
||||
{ SCRIPT_HDR_SIZE,
|
||||
exec_script_makecmds,
|
||||
{ NULL },
|
||||
NULL,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec_script.c,v 1.32 2002/10/29 12:31:23 blymn Exp $ */
|
||||
/* $NetBSD: exec_script.c,v 1.33 2003/04/02 01:00:20 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.32 2002/10/29 12:31:23 blymn Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.33 2003/04/02 01:00:20 perry Exp $");
|
||||
|
||||
#if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS)
|
||||
#define FDSCRIPTS /* Need this for safe set-id scripts. */
|
||||
@ -96,7 +96,7 @@ exec_script_makecmds(struct proc *p, struct exec_package *epp)
|
||||
* (The latter requirement means that we have to check
|
||||
* for both spaces and tabs later on.)
|
||||
*/
|
||||
hdrlinelen = min(epp->ep_hdrvalid, MAXINTERP);
|
||||
hdrlinelen = min(epp->ep_hdrvalid, SCRIPT_HDR_SIZE);
|
||||
for (cp = hdrstr + EXEC_SCRIPT_MAGICLEN; cp < hdrstr + hdrlinelen;
|
||||
cp++) {
|
||||
if (*cp == '\n') {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec_script.h,v 1.7 1997/01/22 07:09:15 mikel Exp $ */
|
||||
/* $NetBSD: exec_script.h,v 1.8 2003/04/02 00:58:56 perry Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christopher G. Demetriou
|
||||
@ -36,6 +36,9 @@
|
||||
#define EXEC_SCRIPT_MAGIC "#!"
|
||||
#define EXEC_SCRIPT_MAGICLEN 2
|
||||
|
||||
/* Extra 2 are for possible space between #! and shell name, and newline. */
|
||||
#define SCRIPT_HDR_SIZE (EXEC_SCRIPT_MAGICLEN + MAXINTERP + 2)
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
/* the shell script handler's entry in the exec switch */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: param.h,v 1.162 2003/03/19 11:57:04 dsl Exp $ */
|
||||
/* $NetBSD: param.h,v 1.163 2003/04/02 00:58:56 perry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1986, 1989, 1993
|
||||
@ -100,7 +100,7 @@
|
||||
#include <sys/syslimits.h>
|
||||
|
||||
#define MAXCOMLEN 16 /* max command name remembered */
|
||||
#define MAXINTERP 64 /* max interpreter file name length */
|
||||
#define MAXINTERP PATH_MAX /* max interpreter file name length */
|
||||
/* DEPRECATED: use LOGIN_NAME_MAX instead. */
|
||||
#define MAXLOGNAME (LOGIN_NAME_MAX - 1) /* max login name length */
|
||||
#define NCARGS ARG_MAX /* max bytes for an exec function */
|
||||
|
Loading…
Reference in New Issue
Block a user