mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Don't allow spaces and don't get confused by -o usesyslogd=yes
(option name has another option name as a prefix)
This commit is contained in:
parent
e6432b1262
commit
da108a9327
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user