|
|
06f80e |
diff -up sendmail-8.14.3/smrsh/README.smrsh_paths sendmail-8.14.3/smrsh/README
|
|
|
06f80e |
--- sendmail-8.14.3/smrsh/README.smrsh_paths 2008-02-12 17:40:06.000000000 +0100
|
|
|
06f80e |
+++ sendmail-8.14.3/smrsh/README 2008-07-15 14:40:36.000000000 +0200
|
|
|
06f80e |
@@ -6,7 +6,7 @@ Software Engineering Institute, Carnegie
|
|
|
06f80e |
intended as a supplement to the CERT advisory CA-93:16.sendmail.vulnerability,
|
|
|
06f80e |
and to the software, smrsh.c, written by Eric Allman.
|
|
|
06f80e |
|
|
|
06f80e |
-
|
|
|
06f80e |
+* Modified by Red Hat, Inc., to reflect different paths. *
|
|
|
06f80e |
|
|
|
06f80e |
The smrsh(8) program is intended as a replacement for /bin/sh in the
|
|
|
06f80e |
program mailer definition of sendmail(8). This README file describes
|
|
|
06f80e |
@@ -56,15 +56,15 @@ These can be added to the devtools/Site/
|
|
|
06f80e |
global M4 macro confENVDEF or the smrsh specific M4 macro
|
|
|
06f80e |
conf_smrsh_ENVDEF.
|
|
|
06f80e |
|
|
|
06f80e |
-As root, install smrsh in /usr/libexec. Using the Build script:
|
|
|
06f80e |
+As root, install smrsh in /usr/sbin. Using the Build script:
|
|
|
06f80e |
|
|
|
06f80e |
host.domain# sh ./Build install
|
|
|
06f80e |
|
|
|
06f80e |
-For manual installation: install smrsh in the /usr/libexec
|
|
|
06f80e |
+For manual installation: install smrsh in the /usr/sbin
|
|
|
06f80e |
directory, with mode 511.
|
|
|
06f80e |
|
|
|
06f80e |
- host.domain# mv smrsh /usr/libexec
|
|
|
06f80e |
- host.domain# chmod 511 /usr/libexec/smrsh
|
|
|
06f80e |
+ host.domain# mv smrsh /usr/sbin
|
|
|
06f80e |
+ host.domain# chmod 511 /usr/sbin/smrsh
|
|
|
06f80e |
|
|
|
06f80e |
|
|
|
06f80e |
|
|
|
06f80e |
@@ -86,7 +86,7 @@ perl(1), uudecode(1) or the stream edito
|
|
|
06f80e |
acceptable commands.
|
|
|
06f80e |
|
|
|
06f80e |
If your platform doesn't have a default SMRSH_CMDDIR setting, you will
|
|
|
06f80e |
-next need to create the directory /usr/adm/sm.bin and populate
|
|
|
06f80e |
+next need to create the directory /etc/smrsh and populate
|
|
|
06f80e |
it with the programs that your site feels are allowable for sendmail
|
|
|
06f80e |
to execute. This directory is explicitly specified in the source
|
|
|
06f80e |
code for smrsh, so changing this directory must be accompanied with
|
|
|
06f80e |
@@ -95,22 +95,22 @@ a change in smrsh.c.
|
|
|
06f80e |
|
|
|
06f80e |
You will have to be root to make these modifications.
|
|
|
06f80e |
|
|
|
06f80e |
-After creating the /usr/adm/sm.bin directory, either copy the programs
|
|
|
06f80e |
+After creating the /etc/smrsh directory, either copy the programs
|
|
|
06f80e |
to the directory, or establish links to the allowable programs from
|
|
|
06f80e |
-/usr/adm/sm.bin. Change the file permissions, so that these programs
|
|
|
06f80e |
+/etc/smrsh. Change the file permissions, so that these programs
|
|
|
06f80e |
can not be modified by non-root users. If you use links, you should
|
|
|
06f80e |
ensure that the target programs are not modifiable.
|
|
|
06f80e |
|
|
|
06f80e |
To allow the popular vacation(1) program by creating a link in the
|
|
|
06f80e |
-/usr/adm/sm.bin directory, you should:
|
|
|
06f80e |
+/etc/smrsh directory, you should:
|
|
|
06f80e |
|
|
|
06f80e |
- host.domain# cd /usr/adm/sm.bin
|
|
|
06f80e |
+ host.domain# cd /etc/smrsh
|
|
|
06f80e |
host.domain# ln -s /usr/ucb/vacation vacation
|
|
|
06f80e |
|
|
|
06f80e |
|
|
|
06f80e |
|
|
|
06f80e |
|
|
|
06f80e |
-After populating the /usr/adm/sm.bin directory, you can now configure
|
|
|
06f80e |
+After populating the /etc/smrsh directory, you can now configure
|
|
|
06f80e |
sendmail to use the restricted shell. Save the current sendmail.cf
|
|
|
06f80e |
file prior to modifying it, as a prudent precaution.
|
|
|
06f80e |
|
|
|
06f80e |
@@ -125,7 +125,7 @@ help to locate it.
|
|
|
06f80e |
|
|
|
06f80e |
In order to configure sendmail to use smrsh, you must modify the Mprog
|
|
|
06f80e |
definition in the sendmail.cf file, by replacing the /bin/sh specification
|
|
|
06f80e |
-with /usr/libexec/smrsh.
|
|
|
06f80e |
+with /usr/sbin/smrsh.
|
|
|
06f80e |
|
|
|
06f80e |
As an example:
|
|
|
06f80e |
|
|
|
06f80e |
@@ -133,14 +133,14 @@ In most Sun Microsystems' sendmail.cf fi
|
|
|
06f80e |
Mprog, P=/bin/sh, F=lsDFMeuP, S=10, R=20, A=sh -c $u
|
|
|
06f80e |
|
|
|
06f80e |
which should be changed to:
|
|
|
06f80e |
-Mprog, P=/usr/libexec/smrsh, F=lsDFMeuP, S=10, R=20, A=sh -c $u
|
|
|
06f80e |
- ^^^^^^^^^^^^^^^^^^
|
|
|
06f80e |
+Mprog, P=/usr/sbin/smrsh, F=lsDFMeuP, S=10, R=20, A=sh -c $u
|
|
|
06f80e |
+ ^^^^^^^^^^^^^^^^
|
|
|
06f80e |
|
|
|
06f80e |
A more generic line may be:
|
|
|
06f80e |
Mprog, P=/bin/sh, F=lsDFM, A=sh -c $u
|
|
|
06f80e |
|
|
|
06f80e |
and should be changed to;
|
|
|
06f80e |
-Mprog, P=/usr/libexec/smrsh, F=lsDFM, A=sh -c $u
|
|
|
06f80e |
+Mprog, P=/usr/sbin/smrsh, F=lsDFM, A=sh -c $u
|
|
|
06f80e |
|
|
|
06f80e |
|
|
|
06f80e |
After modifying the Mprog definition in the sendmail.cf file, if a frozen
|
|
|
06f80e |
@@ -151,7 +151,7 @@ or /etc/mail directories. The specific
|
|
|
06f80e |
a search of the strings(1) output of the sendmail binary.
|
|
|
06f80e |
|
|
|
06f80e |
In order to create a new frozen configuration, if it is required:
|
|
|
06f80e |
- host.domain# /usr/lib/sendmail -bz
|
|
|
06f80e |
+ host.domain# /usr/sbin/sendmail -bz
|
|
|
06f80e |
|
|
|
06f80e |
Now re-start the sendmail process. An example of how to do this on
|
|
|
06f80e |
a typical system follows:
|
|
|
06f80e |
diff -up sendmail-8.14.3/smrsh/smrsh.8.smrsh_paths sendmail-8.14.3/smrsh/smrsh.8
|
|
|
06f80e |
--- sendmail-8.14.3/smrsh/smrsh.8.smrsh_paths 2004-08-06 05:55:35.000000000 +0200
|
|
|
06f80e |
+++ sendmail-8.14.3/smrsh/smrsh.8 2008-07-15 14:38:07.000000000 +0200
|
|
|
06f80e |
@@ -39,7 +39,7 @@ Briefly,
|
|
|
06f80e |
.I smrsh
|
|
|
06f80e |
limits programs to be in a single directory,
|
|
|
06f80e |
by default
|
|
|
06f80e |
-/usr/adm/sm.bin,
|
|
|
06f80e |
+/etc/smrsh,
|
|
|
06f80e |
allowing the system administrator to choose the set of acceptable commands,
|
|
|
06f80e |
and to the shell builtin commands ``exec'', ``exit'', and ``echo''.
|
|
|
06f80e |
It also rejects any commands with the characters
|
|
|
06f80e |
@@ -56,10 +56,10 @@ so forwarding to ``/usr/ucb/vacation'',
|
|
|
06f80e |
and
|
|
|
06f80e |
``vacation''
|
|
|
06f80e |
all actually forward to
|
|
|
06f80e |
-``/usr/adm/sm.bin/vacation''.
|
|
|
06f80e |
+``/etc/smrsh/vacation''.
|
|
|
06f80e |
.PP
|
|
|
06f80e |
System administrators should be conservative about populating
|
|
|
06f80e |
-the sm.bin directory.
|
|
|
06f80e |
+the /etc/smrsh directory.
|
|
|
06f80e |
For example, a reasonable additions is
|
|
|
06f80e |
.IR vacation (1),
|
|
|
06f80e |
and the like.
|
|
|
06f80e |
@@ -68,7 +68,7 @@ never include any shell or shell-like pr
|
|
|
06f80e |
(such as
|
|
|
06f80e |
.IR perl (1))
|
|
|
06f80e |
in the
|
|
|
06f80e |
-sm.bin
|
|
|
06f80e |
+/etc/smrsh
|
|
|
06f80e |
directory.
|
|
|
06f80e |
Note that this does not restrict the use of shell or perl scripts
|
|
|
06f80e |
in the sm.bin directory (using the ``#!'' syntax);
|
|
|
06f80e |
@@ -79,20 +79,7 @@ is a very bad idea.
|
|
|
06f80e |
.IR procmail (1)
|
|
|
06f80e |
allows users to run arbitrary programs in their
|
|
|
06f80e |
.IR procmailrc (5).
|
|
|
06f80e |
-.SH COMPILATION
|
|
|
06f80e |
-Compilation should be trivial on most systems.
|
|
|
06f80e |
-You may need to use \-DSMRSH_PATH=\e"\fIpath\fP\e"
|
|
|
06f80e |
-to adjust the default search path
|
|
|
06f80e |
-(defaults to ``/bin:/usr/bin:/usr/ucb'')
|
|
|
06f80e |
-and/or \-DSMRSH_CMDDIR=\e"\fIdir\fP\e"
|
|
|
06f80e |
-to change the default program directory
|
|
|
06f80e |
-(defaults to ``/usr/adm/sm.bin'').
|
|
|
06f80e |
.SH FILES
|
|
|
06f80e |
-/usr/adm/sm.bin \- default directory for restricted programs on most OSs
|
|
|
06f80e |
-.PP
|
|
|
06f80e |
-/var/adm/sm.bin \- directory for restricted programs on HP UX and Solaris
|
|
|
06f80e |
-.PP
|
|
|
06f80e |
-/usr/libexec/sm.bin \- directory for restricted programs on FreeBSD (>= 3.3) and DragonFly BSD
|
|
|
06f80e |
-
|
|
|
06f80e |
+/etc/smrsh \- directory for restricted programs
|
|
|
06f80e |
.SH SEE ALSO
|
|
|
06f80e |
sendmail(8)
|
|
|
06f80e |
diff -up sendmail-8.14.3/smrsh/smrsh.c.smrsh_paths sendmail-8.14.3/smrsh/smrsh.c
|
|
|
06f80e |
--- sendmail-8.14.3/smrsh/smrsh.c.smrsh_paths 2004-08-06 20:54:22.000000000 +0200
|
|
|
06f80e |
+++ sendmail-8.14.3/smrsh/smrsh.c 2008-07-15 14:38:07.000000000 +0200
|
|
|
06f80e |
@@ -77,7 +77,7 @@ SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.65 20
|
|
|
06f80e |
# ifdef SMRSH_CMDDIR
|
|
|
06f80e |
# define CMDDIR SMRSH_CMDDIR
|
|
|
06f80e |
# else /* SMRSH_CMDDIR */
|
|
|
06f80e |
-# define CMDDIR "/usr/adm/sm.bin"
|
|
|
06f80e |
+# define CMDDIR "/etc/smrsh"
|
|
|
06f80e |
# endif /* SMRSH_CMDDIR */
|
|
|
06f80e |
#endif /* ! CMDDIR */
|
|
|
06f80e |
|
|
|
06f80e |
@@ -89,7 +89,7 @@ SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.65 20
|
|
|
06f80e |
# ifdef SMRSH_PATH
|
|
|
06f80e |
# define PATH SMRSH_PATH
|
|
|
06f80e |
# else /* SMRSH_PATH */
|
|
|
06f80e |
-# define PATH "/bin:/usr/bin:/usr/ucb"
|
|
|
06f80e |
+# define PATH "/bin:/usr/bin"
|
|
|
06f80e |
# endif /* SMRSH_PATH */
|
|
|
06f80e |
#endif /* ! PATH */
|
|
|
06f80e |
|