summaryrefslogtreecommitdiffhomepage
path: root/cli-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2015-12-15 22:23:42 +0800
committerMatt Johnston <matt@ucc.asn.au>2015-12-15 22:23:42 +0800
commitda108a932769806aca0e6e50831a6213becf42c8 (patch)
tree0bcef70d9a2a39c814980a815092cb6b359caf7c /cli-runopts.c
parente6432b1262b399dcbf452b8ae0aa8204d36b24da (diff)
Don't allow spaces and don't get confused by -o usesyslogd=yes
(option name has another option name as a prefix)
Diffstat (limited to 'cli-runopts.c')
-rw-r--r--cli-runopts.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/cli-runopts.c b/cli-runopts.c
index d70a4e1..60b4aa1 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -824,29 +824,22 @@ badport:
#endif
static int match_extendedopt(const char** strptr, const char *optname) {
- int seen_eq = 0;
int optlen = strlen(optname);
const char *str = *strptr;
- while (isspace(*str)) {
- ++str;
- }
-
if (strncasecmp(str, optname, optlen) != 0) {
return DROPBEAR_FAILURE;
}
str += optlen;
- while (isspace(*str) || (!seen_eq && *str == '=')) {
- if (*str == '=') {
- seen_eq = 1;
- }
- ++str;
+ if (*str == '=') {
+ *strptr = str+1;
+ return DROPBEAR_SUCCESS;
+ } else {
+ return DROPBEAR_FAILURE;
}
- *strptr = str;
- return DROPBEAR_SUCCESS;
}
static int parse_flag_value(const char *value) {