- djm@cvs.openbsd.org 2008/03/25 11:58:02

[session.c sshd_config.5]
     ignore ~/.ssh/rc if a sshd_config ForceCommand is specified;
     from dtucker@ ok deraadt@ djm@
This commit is contained in:
Damien Miller 2008-03-27 11:02:02 +11:00
parent e241e85ad3
commit a1b48ccf2d
3 changed files with 14 additions and 7 deletions

View File

@ -33,6 +33,10 @@
works now that kernel fd passing has been fixed to accept a bit of works now that kernel fd passing has been fixed to accept a bit of
sloppiness because of this ABI repair. sloppiness because of this ABI repair.
lots of discussion with kettenis lots of discussion with kettenis
- djm@cvs.openbsd.org 2008/03/25 11:58:02
[session.c sshd_config.5]
ignore ~/.ssh/rc if a sshd_config ForceCommand is specified;
from dtucker@ ok deraadt@ djm@
20080315 20080315
- (djm) [regress/test-exec.sh] Quote putty-related variables in case they are - (djm) [regress/test-exec.sh] Quote putty-related variables in case they are
@ -3801,4 +3805,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@ passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.4886 2008/03/27 00:01:15 djm Exp $ $Id: ChangeLog,v 1.4887 2008/03/27 00:02:02 djm Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: session.c,v 1.230 2008/02/22 05:58:56 djm Exp $ */ /* $OpenBSD: session.c,v 1.231 2008/03/25 11:58:02 djm Exp $ */
/* /*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved * All rights reserved
@ -1202,8 +1202,9 @@ do_rc_files(Session *s, const char *shell)
do_xauth = do_xauth =
s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL; s->display != NULL && s->auth_proto != NULL && s->auth_data != NULL;
/* ignore _PATH_SSH_USER_RC for subsystems */ /* ignore _PATH_SSH_USER_RC for subsystems and admin forced commands */
if (!s->is_subsystem && (stat(_PATH_SSH_USER_RC, &st) >= 0)) { if (!s->is_subsystem && options.adm_forced_command != NULL &&
(stat(_PATH_SSH_USER_RC, &st) >= 0)) {
snprintf(cmd, sizeof cmd, "%s -c '%s %s'", snprintf(cmd, sizeof cmd, "%s -c '%s %s'",
shell, _PATH_BSHELL, _PATH_SSH_USER_RC); shell, _PATH_BSHELL, _PATH_SSH_USER_RC);
if (debug_flag) if (debug_flag)

View File

@ -34,8 +34,8 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.\" $OpenBSD: sshd_config.5,v 1.83 2008/02/11 07:58:28 jmc Exp $ .\" $OpenBSD: sshd_config.5,v 1.84 2008/03/25 11:58:02 djm Exp $
.Dd $Mdocdate: February 11 2008 $ .Dd $Mdocdate: March 25 2008 $
.Dt SSHD_CONFIG 5 .Dt SSHD_CONFIG 5
.Os .Os
.Sh NAME .Sh NAME
@ -324,7 +324,9 @@ for more information on patterns.
.It Cm ForceCommand .It Cm ForceCommand
Forces the execution of the command specified by Forces the execution of the command specified by
.Cm ForceCommand , .Cm ForceCommand ,
ignoring any command supplied by the client. ignoring any command supplied by the client and
.Pa ~/.ssh/rc
if present.
The command is invoked by using the user's login shell with the -c option. The command is invoked by using the user's login shell with the -c option.
This applies to shell, command, or subsystem execution. This applies to shell, command, or subsystem execution.
It is most useful inside a It is most useful inside a