Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/kern/imgact_shell.c

[BACK] Up to [FreeBSD] / src / sys / kern

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.41.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.41.2.1: preferred, colored
Changes since revision 1.41.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.41.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.35.10.2: download - view: text, markup, annotated - select for diffs
Sun Mar 13 13:37:23 2011 UTC (10 months, 4 weeks ago) by kib
Branches: RELENG_7
Diff to: previous 1.35.10.1: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.10.1: +1 -1 lines
SVN rev 219607 on 2011-03-13 13:37:23Z by kib

Fix mismerge.

Pointy hat to:	kib

Revision 1.35.10.1: download - view: text, markup, annotated - select for diffs
Sun Mar 13 10:08:02 2011 UTC (10 months, 4 weeks ago) by kib
Branches: RELENG_7
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +1 -1 lines
SVN rev 219595 on 2011-03-13 10:08:02Z by kib

MFC r219352:
The execution of the shebang script requires putting interpreter path,
possible option and script path in the place of argv[0] supplied to
execve(2).  It is possible and valid for the substitution to be shorter
then the argv[0].

Avoid signed underflow in this case.

PR:     kern/155321

Revision 1.37.2.2: download - view: text, markup, annotated - select for diffs
Sun Mar 13 09:36:52 2011 UTC (10 months, 4 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.37.2.1: preferred, colored; branchpoint 1.37: preferred, colored; next MAIN 1.38: preferred, colored
Changes since revision 1.37.2.1: +1 -1 lines
SVN rev 219594 on 2011-03-13 09:36:52Z by kib

MFC r219352:
The execution of the shebang script requires putting interpreter path,
possible option and script path in the place of argv[0] supplied to
execve(2).  It is possible and valid for the substitution to be shorter
then the argv[0].

Avoid signed underflow in this case.

PR:     kern/155321

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Mar 6 22:59:30 2011 UTC (11 months ago) by kib
Branches: MAIN
CVS tags: RELENG_9_BP, HEAD
Branch point for: RELENG_9
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +1 -1 lines
SVN rev 219352 on 2011-03-06 22:59:30Z by kib

The execution of the shebang script requires putting interpreter path,
possible option and script path in the place of argv[0] supplied to
execve(2).  It is possible and valid for the substitution to be shorter
then the argv[0].

Avoid signed underflow in this case.

Submitted by:	Devon H. O'Dell <devon.odell gmail com>
PR:	kern/155321
MFC after:	1 week

Revision 1.35.24.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.37.2.1.6.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.37.2.1: preferred, colored; next MAIN 1.37.2.2: preferred, colored
Changes since revision 1.37.2.1: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.40: download - view: text, markup, annotated - select for diffs
Tue Sep 21 16:24:51 2010 UTC (16 months, 2 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +16 -12 lines
SVN rev 212965 on 2010-09-21 16:24:51Z by alc

Fix exec_imgact_shell()'s handling of two error cases: (1) Previously, if
the first line of a script exceeded MAXSHELLCMDLEN characters, then
exec_imgact_shell() silently truncated the line and passed on the truncated
interpreter name or argument.  Now, exec_imgact_shell() will fail and return
ENOEXEC, which is the commonly used errno among Unix variants for this type
of error. (2) Previously, exec_imgact_shell()'s check on the length of the
interpreter's name was ineffective.  In other words, exec_imgact_shell()
could not possibly fail and return ENAMETOOLONG.  The reason being that the
length of the interpreter name had to exceed MAXSHELLCMDLEN characters in
order that ENAMETOOLONG be returned.  But, the search for the end of the
interpreter name stops after at most MAXSHELLCMDLEN - 2 characters are
scanned.  (In the end, this particular error is eventually discovered
outside of exec_imgact_shell() and ENAMETOOLONG is returned.  So, the real
effect of this second change is that the error is detected earlier, in
exec_imgact_shell().)

Update the definition of MAXINTERP to the actual limit on the size of
the interpreter name that has been in effect since r142453 (from
2005).

In collaboration with: kib

Revision 1.39: download - view: text, markup, annotated - select for diffs
Tue Jul 27 17:31:03 2010 UTC (18 months, 2 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -2 lines
SVN rev 210545 on 2010-07-27 17:31:03Z by alc

Introduce exec_alloc_args().  The objective being to encapsulate the
details of the string buffer allocation in one place.

Eliminate the portion of the string buffer that was dedicated to storing
the interpreter name.  The pointer to the interpreter name can simply be
made to point to the appropriate argument string.

Reviewed by:	kib

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun Jul 25 17:43:38 2010 UTC (18 months, 2 weeks ago) by alc
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -7 lines
SVN rev 210475 on 2010-07-25 17:43:38Z by alc

Change the order in which the file name, arguments, environment, and
shell command are stored in exec*()'s demand-paged string buffer.  For
a "buildworld" on an 8GB amd64 multiprocessor, the new order reduces
the number of global TLB shootdowns by 31%.  It also eliminates about
330k page faults on the kernel address space.

Change exec_shell_imgact() to use "args->begin_argv" consistently as
the start of the argument and environment strings.  Previously, it
would sometimes use "args->buf", which is the start of the overall
buffer, but no longer the start of the argument and environment
strings.  While I'm here, eliminate unnecessary passing of "&length"
to copystr(), where we don't actually care about the length of the
copied string.

Clean up the initialization of the exec map.  In particular, use the
correct size for an entry, and express that size in the same way that
is used when an entry is allocated.  The old size was one page too
large.  (This discrepancy originated in 2004 when I rewrote
exec_map_first_page() to use sf_buf_alloc() instead of the exec map
for mapping the first page of the executable.)

Reviewed by:	kib

Revision 1.37.2.1.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 3 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.37.2.1: preferred, colored; next MAIN 1.37.2.2: preferred, colored
Changes since revision 1.37.2.1: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.35.22.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (23 months, 4 weeks ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.37.2.1.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.37.2.1: preferred, colored; next MAIN 1.37.2.2: preferred, colored
Changes since revision 1.37.2.1: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.37.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
CVS tags: RELENG_8_2_BP, RELENG_8_1_BP, RELENG_8_0_BP
Branch point for: RELENG_8_2, RELENG_8_1, RELENG_8_0
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.35.20.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.35.18.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.35.16.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.37: download - view: text, markup, annotated - select for diffs
Thu Aug 28 15:23:18 2008 UTC (3 years, 5 months ago) by attilio
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +1 -1 lines
SVN rev 182371 on 2008-08-28 15:23:18Z by attilio

Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.

Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>

Revision 1.36: download - view: text, markup, annotated - select for diffs
Tue Aug 26 10:53:32 2008 UTC (3 years, 5 months ago) by kib
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +22 -5 lines
SVN rev 182191 on 2008-08-26 10:53:32Z by kib

When calculating arguments to the interpreter for the shebang script
executed by fexecve(2), imgp->args->fname is NULL. Moreover, there is
no way to recover the path to the script being executed.
Do what some other U*ixes do unconditionally, namely supply /dev/fd/n
as the script path when called from fexecve(). Document requirement of
having fdescfs mounted as caveat.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sun Jun 19 02:21:03 2005 UTC (6 years, 7 months ago) by gad
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_4_BP, RELENG_7_3_BP, RELENG_7_2_BP, RELENG_7_1_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0, RELENG_6_BP, RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2, RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0, RELENG_6
Branch point for: RELENG_7_4, RELENG_7_3, RELENG_7_2, RELENG_7_1, RELENG_7, RELENG_6_4
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +3 -3 lines
Fix a panic which could occur parsing #!-lines in a shell-script.  If the
#!-line had multiple whitespace characters after the interpreter name, and
it did not have any options, then the code would do nasty things trying to
process a (non-existent) option-string which "ended before it began"...

Submitted by:	Morten Johansen
Approved by:	re (dwhite)

Revision 1.34: download - view: text, markup, annotated - select for diffs
Thu Jun 9 00:27:02 2005 UTC (6 years, 8 months ago) by gad
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -128 lines
Remove the previous parsing-logic for arguments on the '#!'-line of shell
scripts.  As far as I know, no one has needed the '#!#<' kludge to get at
the behavior implemented by the historical parsing.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sat May 28 22:42:41 2005 UTC (6 years, 8 months ago) by gad
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +174 -7 lines
Change the way options are parsed on the `#!'-line of a shell-script.  Instead
of having the kernel parse that line and add an entry to the argument list for
each 'separate word' it finds, have it add only one entry which holds all
the words found on that line.  The old behavior is useful in some situations,
but it does not match the way any other operating system will parse that line.

This has been discussed in the thread "Bug in #! processing - One More Time"
on the freebsd-arch mailing list (starting back on Feb 24, 2005).  The first
few messages in that thread provide the background in much detail.

PR:		16393
Reviewed by:	freebsd-arch

Revision 1.26.4.3: download - view: text, markup, annotated - select for diffs
Wed Mar 2 00:00:13 2005 UTC (6 years, 11 months ago) by gad
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.26.4.2: preferred, colored; branchpoint 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26.4.2: +20 -0 lines
Revert revision 1.26.4.1 before 5.4-release.  This changes shell-option
parsing (on the `#!' line) back to the way it has worked in FreeBSD since
March 2000.  That processing is not correct, but we aren't going to have
the right fix for it tested in time for 5.4-release.  Revision 1.26.4.1
fixed the behavior for some uses, and broke it for others.  In particular,
it broke tricks like:     #!/bin/sh -- # -*- perl -*-
which is recommended (by perl documentation) for some situations.

PR:		16393 (gives history)
Reviewed by:	freebsd-arch

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Feb 25 10:17:53 2005 UTC (6 years, 11 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +27 -12 lines
o Replace two while {} do loops with more appropriate do {} while loops. This
  doesn't change functionality, but makes code more logical.

Obtained from:	DrafonFlyBSD

o Use VOP_GETATTR() to obtain actual size of file and parse no more than that.
  Previously, we parsed MAXSHELLCMDLEN characters regardless of the actual file
  size. This makes the following working:

$ printf '#!/bin/echo' > /tmp/test.sh
$ chmod 755 /tmp/test.sh
$ /tmp/test.sh

Previously, attempts to execve() that shell script has been failing with bogus
ENAMETOOLONG.

PR:		kern/64196
Submitted by:	Magnus B.ckstr.m <b@etek.chalmers.se>

Revision 1.31: download - view: text, markup, annotated - select for diffs
Fri Feb 25 08:42:04 2005 UTC (6 years, 11 months ago) by sobomax
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +9 -7 lines
Try harder to not exceed MAXSHELLCMDLEN when parsing first line of shell
script. Otherwise it's possible to panic kernel by constructing a shell
script with first line not ending in '\n'.

Also, treat '\0' as line terminating character, which may me useful in
some situations.

Submitted by:	gad

Revision 1.26.4.2: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:26:15 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.26.4.1: preferred, colored; branchpoint 1.26: preferred, colored
Changes since revision 1.26.4.1: +1 -1 lines
MFC: /*- and related license changes

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Jan 30 06:43:17 2005 UTC (7 years ago) by sobomax
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +2 -1 lines
Fix build on AMD64 (and probably other arches where size_t != int).

Submitted by:	Tinderbox
MFC after:	2 weeks

Revision 1.29: download - view: text, markup, annotated - select for diffs
Sat Jan 29 23:11:59 2005 UTC (7 years ago) by sobomax
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +94 -48 lines
o Split out kernel part of execve(2) syscall into two parts: one that
  copies arguments into the kernel space and one that operates
  completely in the kernel space;

o use kernel-only version of execve(2) to kill another stackgap in
  linuxlator/i386.

Obtained from:  DragonFlyBSD (partially)
MFC after:      2 weeks

Revision 1.28: download - view: text, markup, annotated - select for diffs
Thu Jan 6 23:35:38 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +1 -1 lines
/* -> /*- for copyright notices, minor format tweaks as necessary

Revision 1.26.4.1: download - view: text, markup, annotated - select for diffs
Mon Nov 8 12:17:12 2004 UTC (7 years, 3 months ago) by pjd
Branches: RELENG_5
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +1 -1 lines
MFC:	Don't treat # as a comment in interpreter specification line.
	This is magic and no other operating system do so (i.e. Solaris, Tru64,
	Linux, AIX, HP-UX, Irix, MacOS X, NetBSD).

Discussed on:	current@
Reported by:	Sławek Żak <zaks@prioris.mini.pw.edu.pl>

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sun Oct 31 11:12:59 2004 UTC (7 years, 3 months ago) by pjd
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +1 -1 lines
Don't treat # as a comment in interpreter specification line.
This is magic and no other operating system do so (i.e. Solaris, Tru64,
Linux, AIX, HP-UX, Irix, MacOS X, NetBSD).

Discussed on:	current@
Reported by:	Sławek Żak <zaks@prioris.mini.pw.edu.pl>

Revision 1.26: download - view: text, markup, annotated - select for diffs
Wed Jun 11 00:56:54 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3, RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Branch point for: RELENG_5
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -2 lines
Use __FBSDID().

Revision 1.25: download - view: text, markup, annotated - select for diffs
Wed Jan 1 18:48:54 2003 UTC (9 years, 1 month ago) by schweikh
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +1 -1 lines
Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue Nov 5 01:59:55 2002 UTC (9 years, 3 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +1 -1 lines
Remove reference to struct execve_args from struct imgact, which
describes an image activation instance.  Instead, make use of the
existing fname structure entry, and introduce two new entries,
userspace_argv, and userspace_envv.  With the addition of
mac_execve(), this divorces the image structure from the specifics
of the execve() system call, removes a redundant pointer, etc.
No semantic change from current behavior, but it means that the
structure doesn't depend on syscalls.master-generated includes.

There seems to be some redundant initialization of imgact entries,
which I have maintained, but which could probably use some cleaning
up at some point.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories

Revision 1.21.2.2: download - view: text, markup, annotated - select for diffs
Sat Dec 22 01:21:39 2001 UTC (10 years, 1 month ago) by jwd
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.21.2.1: preferred, colored; branchpoint 1.21: preferred, colored; next MAIN 1.22: preferred, colored
Changes since revision 1.21.2.1: +2 -2 lines
MFC of kern/32106

       1.30  src/lib/libc/sys/execve.2
       1.23  src/sys/kern/imgact_shell.c
       1.25  src/sys/sys/imgact.h

  Return a more meaningful errno when the length of the interpreter
  exceeds MAXSHELLCMDLEN to avoid secondary /bin/sh execution.

  Update execve man page to reflect change.

  Increase MAXSHELLCMDLEN to a slightly more meaningful value.

Approved by:	re

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Nov 28 03:26:53 2001 UTC (10 years, 2 months ago) by jwd
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -2 lines
Return a more meaningful errno when the length of the interpreter
exceeds MAXSHELLCMDLEN to avoid secondary /bin/sh execution.

Update execve man page to reflect change.

Increase MAXSHELLCMDLEN to a slightly more meaningful value.

PR:		kern/32106
Submitted by:	b@etek.chalmers.se
Reviewed by:	bsd
MFC after:	2 weeks

Revision 1.21.2.1: download - view: text, markup, annotated - select for diffs
Tue May 9 17:41:23 2000 UTC (11 years, 9 months ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4, RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3, RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -6 lines
    MFC i386/linux/imgact_linux.c 1.36 and friends - fix #! script exec
    under linux emulation to look for script binary in /compat/linux first.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed Apr 26 20:58:39 2000 UTC (11 years, 9 months ago) by dillon
Branches: MAIN
CVS tags: PRE_SMPNG, KSE_PRE_MILESTONE_2, KSE_MILESTONE_2
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -6 lines
    Fix #! script exec under linux emulation.  If a script is exec'd from a
    program running under linux emulation, the script binary is checked for
    in /compat/linux first.  Without this patch the wrong script binary
    (i.e. the FreeBSD binary) will be run instead of the linux binary.
    For example, #!/bin/sh, thus breaking out of linux compatibility mode.

    This solves a number of problems people have had installing linux
    software on FreeBSD boxes.

Revision 1.17.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 20 12:22:49 2000 UTC (11 years, 10 months ago) by cracauer
Branches: RELENG_3
CVS tags: RELENG_3_5_0_RELEASE
Diff to: previous 1.17.2.1: preferred, colored; branchpoint 1.17: preferred, colored; next MAIN 1.18: preferred, colored
Changes since revision 1.17.2.1: +2 -2 lines
MFC: allow comments in #!/bin/sh # - line

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Feb 15 08:49:57 2000 UTC (11 years, 11 months ago) by cracauer
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -2 lines
Allow comments in interpreter specification lines as in
#! /bin/sh # -*- perl -*-

This is simply "delete everything after the next '#', not counting the
first char in the line". No effort has been made to allow quoting,
backslash escaping or '#' in interpreter names.

The complies to POSIX 1003.2 in that Posix says the implementation is
free to choose whatever it likes.

PR:		bin/16393

Revision 1.6.8.3: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:32:02 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_1_0
Diff to: previous 1.6.8.2: preferred, colored; branchpoint 1.6: preferred, colored; next MAIN 1.7: preferred, colored
Changes since revision 1.6.8.2: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.12.2.2: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:14:46 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_2_2
Diff to: previous 1.12.2.1: preferred, colored; branchpoint 1.12: preferred, colored; next MAIN 1.13: preferred, colored
Changes since revision 1.12.2.1: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.17.2.1: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:25:55 1999 UTC (12 years, 5 months ago) by peter
Branches: RELENG_3
CVS tags: RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:46:10 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun May 9 16:04:10 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +1 -3 lines
Fix a couple of warnings and some bitrot in comments.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Jan 29 22:59:43 1999 UTC (13 years ago) by dillon
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, PRE_SMP_VMSHARE, PRE_NEWBUS, POST_VFS_BIO_NFS_PATCH, POST_SMP_VMSHARE, POST_NEWBUS
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -2 lines
    *_execsw static structures cannot be const due to the way they interact
    with EXEC_SET, DECLARE_MODULE, and module_register.  Specifically,
    module_register.  We may eventually be able to make these const, but
    not now.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Fri Oct 16 03:55:00 1998 UTC (13 years, 3 months ago) by peter
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE, RELENG_3_1_0_RELEASE, RELENG_3_0_0_RELEASE
Branch point for: RELENG_3
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +3 -2 lines
*gulp*.  Jordan specifically OK'ed this..

This is the bulk of the support for doing kld modules.  Two linker_sets
were replaced by SYSINIT()'s.  VFS's and exec handlers are self registered.
kld is now a superset of lkm.  I have converted most of them, they will
follow as a seperate commit as samples.
This all still works as a static a.out kernel using LKM's.

Revision 1.12.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 2 09:57:17 1997 UTC (14 years, 2 months ago) by danny
Branches: RELENG_2_2
CVS tags: RELENG_2_2_8_RELEASE, RELENG_2_2_7_RELEASE, RELENG_2_2_6_RELEASE
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -3 lines
Submitted by:	bde
Merge Bruce's fix for PR bin/5172 from HEAD

Revision 1.16: download - view: text, markup, annotated - select for diffs
Sat Aug 2 14:31:23 1997 UTC (14 years, 6 months ago) by bde
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, PRE_NOBDEV, PRE_DEVFS_SLICE, POST_SOFTUPDATE, POST_DEVFS_SLICE
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +1 -4 lines
Removed unused #includes.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Apr 23 22:07:04 1997 UTC (14 years, 9 months ago) by ache
Branches: MAIN
CVS tags: pre_smp_merge, post_smp_merge, WOLLMAN_MBUF, BP_WOLLMAN_MBUF
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +2 -3 lines
Don't clobber user space argv0 memory on shell exec, mainly for vfork()
Fix another bug: if argv[0] is NULL, garbadge args might be added for
shell script
Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no> (with yet one fault detect from me)

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:38:57 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$.  We are not
ready for it yet.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:43:05 1997 UTC (15 years ago) by jkh
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sat Aug 31 16:52:24 1996 UTC (15 years, 5 months ago) by bde
Branches: MAIN
CVS tags: RELENG_2_2_BP, RELENG_2_2_5_RELEASE, RELENG_2_2_2_RELEASE, RELENG_2_2_1_RELEASE, RELENG_2_2_0_RELEASE
Branch point for: RELENG_2_2
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +2 -2 lines
Fixed the easy cases of const poisoning in the kernel.  Cosmetic.

Revision 1.6.8.2: download - view: text, markup, annotated - select for diffs
Mon Apr 8 01:28:08 1996 UTC (15 years, 10 months ago) by davidg
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_7_RELEASE, RELENG_2_1_6_RELEASE, RELENG_2_1_6_1_RELEASE, RELENG_2_1_5_RELEASE
Diff to: previous 1.6.8.1: preferred, colored; branchpoint 1.6: preferred, colored
Changes since revision 1.6.8.1: +1 -6 lines
From current: updates to my copyright.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Apr 8 01:21:58 1996 UTC (15 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +1 -6 lines
Killed sections 3 and 4 of my copyright as I don't agree with it (I believe
it to be unnecessarily restrictive). For tty_subr.c, update to my standard
copyright.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Sat Dec 2 16:32:03 1995 UTC (16 years, 2 months ago) by bde
Branches: MAIN
CVS tags: wollman_polling
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +4 -2 lines
Staticized.

Added prototypes.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Nov 6 12:52:31 1995 UTC (16 years, 3 months ago) by davidg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +15 -15 lines
All:
   Changed vnodep -> vp for consistency with the rest of the kernel, and
changed iparams -> imgp for brevity.

kern_exec.c:
   Explicitly initialized some additional parts of the image_params struct
to avoid bzeroing it. Rewrote the set-id code to reduce the number of
logical tests. The rewrite exposed a mostly benign bug in the algorithm:
traced set-id images would get ktracing disabled even if the set-id didn't
happen for other reasons.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sun Oct 8 00:05:58 1995 UTC (16 years, 4 months ago) by swallace
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +2 -1 lines
Remove prototype definitions from <sys/systm.h>.
Prototypes are located in <sys/sysproto.h>.

Add appropriate #include <sys/sysproto.h> to files that needed
protos from systm.h.

Add structure definitions to appropriate files that relied on sys/systm.h,
right before system call definition, as in the rest of the kernel source.

In kern_prot.c, instead of using the dummy structure "args", create
individual dummy structures named <syscall>_args.  This makes
life easier for prototype generation.

Revision 1.6.8.1: download - view: text, markup, annotated - select for diffs
Fri Sep 8 13:25:46 1995 UTC (16 years, 5 months ago) by davidg
Branches: RELENG_2_1_0
CVS tags: RELENG_2_1_0_RELEASE
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -2 lines
Fixed my copyright.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Fri Sep 8 13:24:33 1995 UTC (16 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -2 lines
Fix my copyright.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Sep 25 19:33:32 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
CVS tags: RELENG_2_1_0_BP, RELENG_2_0_5_RELEASE, RELENG_2_0_5_BP, RELENG_2_0_5_ALPHA, RELENG_2_0_5, RELEASE_2_0, OLAH_TTCP, BETA_2_0, ALPHA_2_0
Branch point for: RELENG_2_1_0
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +1 -3 lines
While in the real world, I had a bad case of being swapped out for a lot of
cycles.  While waiting there I added a lot of the extra ()'s I have, (I have
never used LISP to any extent).  So I compiled the kernel with -Wall and
shut up a lot of "suggest you add ()'s", removed a bunch of unused var's
and added a couple of declarations here and there.  Having a lap-top is
highly recommended.  My kernel still runs, yell at me if you kernel breaks.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Aug 18 22:34:56 1994 UTC (17 years, 5 months ago) by wollman
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +2 -2 lines
Fix up some sloppy coding practices:

- Delete redundant declarations.
- Add -Wredundant-declarations to Makefile.i386 so they don't come back.
- Delete sloppy COMMON-style declarations of uninitialized data in
  header files.
- Add a few prototypes.
- Clean up warnings resulting from the above.

NB: ioconf.c will still generate a redundant-declaration warning, which
is unavoidable unless somebody volunteers to make `config' smarter.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Aug 13 03:50:23 1994 UTC (17 years, 6 months ago) by wollman
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +7 -7 lines
Change all #includes to follow the current Berkeley style.  Some of these
``changes'' are actually not changes at all, but CVS sometimes has trouble
telling the difference.

This also includes support for second-directory compiles.  This is not
quite complete yet, as `config' doesn't yet do the right thing.  You can
still make it work trivially, however, by doing the following:

rm /sys/compile
mkdir /usr/obj/sys/compile
ln -s M-. /sys/compile
cd /sys/i386/conf
config MYKERNEL
cd ../../compile/MYKERNEL
ln -s /sys @
rm machine
ln -s @/i386/include machine
make depend
make

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed May 25 09:02:06 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -0 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Dec 20 19:31:15 1993 UTC (18 years, 1 month ago) by wollman
Branches: MAIN
CVS tags: REL_before_johndavid_2_0_0, MOVED_NEWCVS, GAMMA_1_1, FINAL_1_1, BP_BETA_1_1, BETA_1_1
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +16 -1 lines
Let the linker keep track of pseudo-devices needing initialization and
image activators, rather than listing them inline in the code.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Mon Dec 20 16:16:46 1993 UTC (18 years, 1 month ago) by wollman
Branches: MAIN
Rename aout_imgact.c and shell_imgact.c to imgact_* for consistency.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options