summaryrefslogtreecommitdiff
path: root/compat.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2015-01-19 20:20:20 +0000
committerDamien Miller <djm@mindrot.org>2015-01-20 09:19:40 +1100
commit48b3b2ba75181f11fca7f327058a591f4426cade (patch)
tree29e083d85f8a0ee2b10ea7c087dc23ce95f29dc2 /compat.c
parent57d10cbe861a235dd269c74fb2fe248469ecee9d (diff)
upstream commit
store compat flags in struct ssh; ok djm@
Diffstat (limited to 'compat.c')
-rw-r--r--compat.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/compat.c b/compat.c
index 8f0f10c8..4852fb70 100644
--- a/compat.c
+++ b/compat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat.c,v 1.86 2014/10/08 22:15:27 djm Exp $ */
+/* $OpenBSD: compat.c,v 1.87 2015/01/19 20:20:20 markus Exp $ */
/*
* Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
*
@@ -57,7 +57,7 @@ enable_compat13(void)
compat13 = 1;
}
/* datafellows bug compatibility */
-void
+u_int
compat_datafellows(const char *version)
{
int i;
@@ -174,13 +174,14 @@ compat_datafellows(const char *version)
for (i = 0; check[i].pat; i++) {
if (match_pattern_list(version, check[i].pat,
strlen(check[i].pat), 0) == 1) {
- datafellows = check[i].bugs;
debug("match: %s pat %s compat 0x%08x",
- version, check[i].pat, datafellows);
- return;
+ version, check[i].pat, check[i].bugs);
+ datafellows = check[i].bugs; /* XXX for now */
+ return check[i].bugs;
}
}
debug("no match: %s", version);
+ return 0;
}
#define SEP ","
@@ -192,7 +193,9 @@ proto_spec(const char *spec)
if (spec == NULL)
return ret;
- q = s = xstrdup(spec);
+ q = s = strdup(spec);
+ if (s == NULL)
+ return ret;
for ((p = strsep(&q, SEP)); p && *p != '\0'; (p = strsep(&q, SEP))) {
switch (atoi(p)) {
case 1: