- djm@cvs.openbsd.org 2013/10/20 06:19:28

[readconf.c ssh_config.5]
     rename "command" subclause of the recently-added "Match" keyword to
     "exec"; it's shorter, clearer in intent and we might want to add the
     ability to match against the command being executed at the remote end in
     the future.
This commit is contained in:
Damien Miller 2013-10-23 16:29:40 +11:00
parent 5c86ebdf83
commit 8a04be795f
3 changed files with 15 additions and 9 deletions

View File

@ -3,6 +3,12 @@
- djm@cvs.openbsd.org 2013/10/20 04:39:28 - djm@cvs.openbsd.org 2013/10/20 04:39:28
[ssh_config.5] [ssh_config.5]
document % expansions performed by "Match command ..." document % expansions performed by "Match command ..."
- djm@cvs.openbsd.org 2013/10/20 06:19:28
[readconf.c ssh_config.5]
rename "command" subclause of the recently-added "Match" keyword to
"exec"; it's shorter, clearer in intent and we might want to add the
ability to match against the command being executed at the remote end in
the future.
20131018 20131018
- (djm) OpenBSD CVS Sync - (djm) OpenBSD CVS Sync

View File

@ -1,4 +1,4 @@
/* $OpenBSD: readconf.c,v 1.209 2013/10/16 22:49:38 djm Exp $ */ /* $OpenBSD: readconf.c,v 1.210 2013/10/20 06:19:27 djm Exp $ */
/* /*
* Author: Tatu Ylonen <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -504,7 +504,7 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw,
debug("%.200s line %d: matched " debug("%.200s line %d: matched "
"'LocalUser %.100s' ", "'LocalUser %.100s' ",
filename, linenum, pw->pw_name); filename, linenum, pw->pw_name);
} else if (strcasecmp(attrib, "command") == 0) { } else if (strcasecmp(attrib, "exec") == 0) {
if (gethostname(thishost, sizeof(thishost)) == -1) if (gethostname(thishost, sizeof(thishost)) == -1)
fatal("gethostname: %s", strerror(errno)); fatal("gethostname: %s", strerror(errno));
strlcpy(shorthost, thishost, sizeof(shorthost)); strlcpy(shorthost, thishost, sizeof(shorthost));
@ -523,11 +523,11 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw,
(char *)NULL); (char *)NULL);
r = execute_in_shell(cmd); r = execute_in_shell(cmd);
if (r == -1) { if (r == -1) {
fatal("%.200s line %d: match command '%.100s' " fatal("%.200s line %d: match exec '%.100s' "
"error", filename, linenum, cmd); "error", filename, linenum, cmd);
} else if (r == 0) { } else if (r == 0) {
debug("%.200s line %d: matched " debug("%.200s line %d: matched "
"'Command \"%.100s\"' ", "'exec \"%.100s\"' ",
filename, linenum, cmd); filename, linenum, cmd);
} else } else
result = 0; result = 0;

View File

@ -33,7 +33,7 @@
.\" (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: ssh_config.5,v 1.175 2013/10/20 04:39:28 djm Exp $ .\" $OpenBSD: ssh_config.5,v 1.176 2013/10/20 06:19:28 djm Exp $
.Dd $Mdocdate: October 20 2013 $ .Dd $Mdocdate: October 20 2013 $
.Dt SSH_CONFIG 5 .Dt SSH_CONFIG 5
.Os .Os
@ -136,7 +136,7 @@ keyword) to be used only when the conditions following the
keyword are satisfied. keyword are satisfied.
Match conditions are specified using one or more keyword/criteria pairs. Match conditions are specified using one or more keyword/criteria pairs.
The available keywords are: The available keywords are:
.Cm command , .Cm exec ,
.Cm host , .Cm host ,
.Cm originalhost , .Cm originalhost ,
.Cm user , .Cm user ,
@ -144,8 +144,8 @@ and
.Cm localuser . .Cm localuser .
.Pp .Pp
The criteria for the The criteria for the
.Cm command .Cm exec
keyword is a path to a command that is executed. keyword is command that is executed under the user's shell..
If the command returns a zero exit status then the condition is considered true. If the command returns a zero exit status then the condition is considered true.
Commands containing whitespace characters must be quoted. Commands containing whitespace characters must be quoted.
The following character sequences in the command will be expanded prior to The following character sequences in the command will be expanded prior to
@ -158,7 +158,7 @@ will be substituted by the local host name (including any domain name),
will be substituted by the target host name, will be substituted by the target host name,
.Ql %n .Ql %n
will be substituted by the original target host name will be substituted by the original target host name
specified on the command line, specified on the command-line,
.Ql %p .Ql %p
the destination port, the destination port,
.Ql %r .Ql %r