mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 07:44:29 +02:00
- djm@cvs.openbsd.org 2014/02/22 01:32:19
[readconf.c] when processing Match blocks, skip 'exec' clauses if previous predicates failed to match; ok markus@
This commit is contained in:
parent
0890dc8191
commit
0628780abe
@ -8,9 +8,10 @@
|
|||||||
[channels.c]
|
[channels.c]
|
||||||
avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W;
|
avoid spurious "getsockname failed: Bad file descriptor" errors in ssh -W;
|
||||||
bz#2200, debian#738692 via Colin Watson; ok dtucker@
|
bz#2200, debian#738692 via Colin Watson; ok dtucker@
|
||||||
|
- djm@cvs.openbsd.org 2014/02/22 01:32:19
|
||||||
20140221
|
[readconf.c]
|
||||||
- (tim) [configure.ac] Fix cut-and-paste error. Patch from Bryan Drewery.
|
when processing Match blocks, skip 'exec' clauses if previous predicates
|
||||||
|
failed to match; ok markus@
|
||||||
|
|
||||||
20140213
|
20140213
|
||||||
- (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}] Add compat
|
- (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}] Add compat
|
||||||
|
31
readconf.c
31
readconf.c
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: readconf.c,v 1.216 2014/01/29 06:18:35 djm Exp $ */
|
/* $OpenBSD: readconf.c,v 1.217 2014/02/22 01:32:19 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
|
||||||
@ -537,16 +537,27 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw,
|
|||||||
"r", ruser,
|
"r", ruser,
|
||||||
"u", pw->pw_name,
|
"u", pw->pw_name,
|
||||||
(char *)NULL);
|
(char *)NULL);
|
||||||
r = execute_in_shell(cmd);
|
if (result != 1) {
|
||||||
if (r == -1) {
|
/* skip execution if prior predicate failed */
|
||||||
fatal("%.200s line %d: match exec '%.100s' "
|
debug("%.200s line %d: skipped exec \"%.100s\"",
|
||||||
"error", filename, linenum, cmd);
|
|
||||||
} else if (r == 0) {
|
|
||||||
debug("%.200s line %d: matched "
|
|
||||||
"'exec \"%.100s\"' ",
|
|
||||||
filename, linenum, cmd);
|
filename, linenum, cmd);
|
||||||
} else
|
} else {
|
||||||
result = 0;
|
r = execute_in_shell(cmd);
|
||||||
|
if (r == -1) {
|
||||||
|
fatal("%.200s line %d: match exec "
|
||||||
|
"'%.100s' error", filename,
|
||||||
|
linenum, cmd);
|
||||||
|
} else if (r == 0) {
|
||||||
|
debug("%.200s line %d: matched "
|
||||||
|
"'exec \"%.100s\"'", filename,
|
||||||
|
linenum, cmd);
|
||||||
|
} else {
|
||||||
|
debug("%.200s line %d: no match "
|
||||||
|
"'exec \"%.100s\"'", filename,
|
||||||
|
linenum, cmd);
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
free(cmd);
|
free(cmd);
|
||||||
} else {
|
} else {
|
||||||
error("Unsupported Match attribute %s", attrib);
|
error("Unsupported Match attribute %s", attrib);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user