summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1997-05-07 11:42:00 +0000
committersteve <steve@FreeBSD.org>1997-05-07 11:42:00 +0000
commit360ef2058cf26054e24616f008f2e7f4fdbe20da (patch)
tree34cd9486cf06eeea744aac11e2ca7cc82949ed51 /bin/sh
parenta29053c495da4ef179561fdd94ea5ce4d57437da (diff)
downloadFreeBSD-src-360ef2058cf26054e24616f008f2e7f4fdbe20da.zip
FreeBSD-src-360ef2058cf26054e24616f008f2e7f4fdbe20da.tar.gz
Revise the section that explains how to protect parts of an $ENV script
from being executed in non-interactive mode. Suggested and Reviewed by: Brian Somers <brian@freebsd.org>
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/sh.132
1 files changed, 12 insertions, 20 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index 8157ed9..d6cae93 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -33,7 +33,7 @@
.\" SUCH DAMAGE.
.\"
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
-.\" $Id: sh.1,v 1.12 1997/02/22 13:58:43 peter Exp $
+.\" $Id: sh.1,v 1.13 1997/04/28 03:20:09 steve Exp $
.\"
.Dd May 5, 1995
.Dt SH 1
@@ -113,31 +113,23 @@ of your home directory
.sp
substituting for
.Pa .shinit
-any filename you wish. Since the
-.Ev ENV
-file is read for
-every invocation of the shell, including shell scripts and
-non-interactive shells, the following paradigm is useful
-for restricting commands in the
-.Ev ENV
-file to interactive invocations. Place commands within the
-.Dq case
-and
-.Dq esac
-below:
-.Bd -literal -offset indent
-case $- in *i*)
- # commands for interactive use only
- ...
-esac
-.Ed
-.Pp
+any filename you wish.
If commandline arguments besides the options have been
specified, then the shell treats the first argument as the
name of a file from which to read commands (a shell script), and
the remaining arguments are set as the positional parameters
of the shell ($1, $2, etc). Otherwise, the shell reads commands
from its standard input.
+.Pp
+Unlike older versions of
+.Nm
+the
+.Ev ENV
+script is only sourced on invocation of interactive shells. This
+closes a well-known, and sometimes easily exploitable security
+hole related to poorly thought out
+.Ev ENV
+scripts.
.Ss Argument List Processing
All of the single letter options to
.Nm
OpenPOWER on IntegriCloud