-/* $OpenBSD: servconf.c,v 1.435 2025/09/25 06:31:42 djm Exp $ */
+/* $OpenBSD: servconf.c,v 1.436 2025/11/20 05:10:56 dtucker Exp $ */
/*
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
* All rights reserved
}
while ((oattrib = argv_next(acp, avp)) != NULL) {
- attrib = xstrdup(oattrib);
/* Terminate on comment */
- if (*attrib == '#') {
+ if (*oattrib == '#') {
argv_consume(acp); /* mark all arguments consumed */
break;
}
+ attrib = xstrdup(oattrib);
arg = NULL;
attributes++;
/* Criterion "all" has no argument and must appear alone */
if (strcasecmp(attrib, "invalid-user") == 0) {
if (ci == NULL) {
result = 0;
- continue;
+ goto next;
}
if (ci->user_invalid == 0)
result = 0;
else
debug("matched invalid-user at line %d", line);
- continue;
+ goto next;
}
/* Keep this list in sync with below */
if (strcasecmp(attrib, "user") == 0) {
if (ci == NULL || (ci->test && ci->user == NULL)) {
result = 0;
- continue;
+ goto next;
}
if (ci->user == NULL)
match_test_missing_fatal("User", "user");
} else if (strcasecmp(attrib, "group") == 0) {
if (ci == NULL || (ci->test && ci->user == NULL)) {
result = 0;
- continue;
+ goto next;
}
if (ci->user == NULL)
match_test_missing_fatal("Group", "user");
} else if (strcasecmp(attrib, "host") == 0) {
if (ci == NULL || (ci->test && ci->host == NULL)) {
result = 0;
- continue;
+ goto next;
}
if (ci->host == NULL)
match_test_missing_fatal("Host", "host");
fatal("Invalid Match address argument "
"'%s' at line %d", arg, line);
result = 0;
- continue;
+ goto next;
}
if (ci->address == NULL)
match_test_missing_fatal("Address", "addr");
"argument '%s' at line %d", arg,
line);
result = 0;
- continue;
+ goto next;
}
if (ci->laddress == NULL)
match_test_missing_fatal("LocalAddress",
}
if (ci == NULL || (ci->test && ci->lport == -1)) {
result = 0;
- continue;
+ goto next;
}
if (ci->lport == 0)
match_test_missing_fatal("LocalPort", "lport");
} else if (strcasecmp(attrib, "rdomain") == 0) {
if (ci == NULL || (ci->test && ci->rdomain == NULL)) {
result = 0;
- continue;
+ goto next;
}
if (ci->rdomain == NULL)
match_test_missing_fatal("RDomain", "rdomain");
result = -1;
goto out;
}
+ next:
free(attrib);
attrib = NULL;
}