aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-06-02 19:06:33 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-06-02 19:29:28 +0200
commitfcf8af20f81f196cff69a32d7a38a0e193e07d54 (patch)
tree8563adde036022902214edf127ccc23f051d5d76 /src/config.c
parent2d28ee7d22a0169f73566ba57b3938ec07bacbd8 (diff)
downloadlibssh-fcf8af20f81f196cff69a32d7a38a0e193e07d54.tar.gz
libssh-fcf8af20f81f196cff69a32d7a38a0e193e07d54.tar.xz
libssh-fcf8af20f81f196cff69a32d7a38a0e193e07d54.zip
BUG 103: Fix ProxyCommand parsing.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index cb98a604..632a50bb 100644
--- a/src/config.c
+++ b/src/config.c
@@ -82,7 +82,7 @@ static enum ssh_config_opcode_e ssh_config_get_opcode(char *keyword) {
return SOC_UNSUPPORTED;
}
-static char *ssh_config_get_token(char **str) {
+static char *ssh_config_get_cmd(char **str) {
register char *c;
char *r;
@@ -103,6 +103,25 @@ static char *ssh_config_get_token(char **str) {
}
for (r = c; *c; c++) {
+ if (*c == '\n') {
+ *c = '\0';
+ goto out;
+ }
+ }
+
+out:
+ *str = c + 1;
+
+ return r;
+}
+
+static char *ssh_config_get_token(char **str) {
+ register char *c;
+ char *r;
+
+ c = ssh_config_get_cmd(str);
+
+ for (r = c; *c; c++) {
if (isblank(*c)) {
*c = '\0';
goto out;
@@ -299,7 +318,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
}
break;
case SOC_PROXYCOMMAND:
- p = ssh_config_get_str(&s, NULL);
+ p = ssh_config_get_cmd(&s);
if (p && *parsing) {
ssh_options_set(session, SSH_OPTIONS_PROXYCOMMAND, p);
}