Bugzilla – Attachment 3647 Details for
Bug 3515
PermitRemoteOpen not behaving as expected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
don't consume first PermitRemoteOpen argument
bz3515.diff (text/plain), 2.39 KB, created by
Damien Miller
on 2022-12-31 11:17:51 AEDT
(
hide
)
Description:
don't consume first PermitRemoteOpen argument
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2022-12-31 11:17:51 AEDT
Size:
2.39 KB
patch
obsolete
>diff --git a/readconf.c b/readconf.c >index 6e3f697..ccb5930 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -1554,37 +1554,37 @@ parse_pubkey_algos: > case oPermitRemoteOpen: > uintptr = &options->num_permitted_remote_opens; > cppptr = &options->permitted_remote_opens; >- arg = argv_next(&ac, &av); >- if (!arg || *arg == '\0') >- fatal("%s line %d: missing %s specification", >- filename, linenum, lookup_opcode_name(opcode)); > uvalue = *uintptr; /* modified later */ >- if (strcmp(arg, "any") == 0 || strcmp(arg, "none") == 0) { >- if (*activep && uvalue == 0) { >- *uintptr = 1; >- *cppptr = xcalloc(1, sizeof(**cppptr)); >- (*cppptr)[0] = xstrdup(arg); >- } >- break; >- } >+ i = 0; > while ((arg = argv_next(&ac, &av)) != NULL) { > arg2 = xstrdup(arg); >- p = hpdelim(&arg); >- if (p == NULL) { >- fatal("%s line %d: missing host in %s", >- filename, linenum, >- lookup_opcode_name(opcode)); >- } >- p = cleanhostname(p); >- /* >- * don't want to use permitopen_port to avoid >- * dependency on channels.[ch] here. >- */ >- if (arg == NULL || >- (strcmp(arg, "*") != 0 && a2port(arg) <= 0)) { >- fatal("%s line %d: bad port number in %s", >- filename, linenum, >- lookup_opcode_name(opcode)); >+ /* Allow any/none only in first position */ >+ if (strcasecmp(arg, "none") == 0 || >+ strcasecmp(arg, "any") == 0) { >+ if (i > 0 || ac > 0) { >+ error("%s line %d: keyword %s \"%s\" " >+ "argument must appear alone.", >+ filename, linenum, keyword, arg); >+ goto out; >+ } >+ } else { >+ p = hpdelim(&arg); >+ if (p == NULL) { >+ fatal("%s line %d: missing host in %s", >+ filename, linenum, >+ lookup_opcode_name(opcode)); >+ } >+ p = cleanhostname(p); >+ /* >+ * don't want to use permitopen_port to avoid >+ * dependency on channels.[ch] here. >+ */ >+ if (arg == NULL || (strcmp(arg, "*") != 0 && >+ a2port(arg) <= 0)) { >+ fatal("%s line %d: bad port number " >+ "in %s", filename, linenum, >+ lookup_opcode_name(opcode)); >+ } > } > if (*activep && uvalue == 0) { > opt_array_append(filename, linenum, >@@ -1592,7 +1592,11 @@ parse_pubkey_algos: > cppptr, uintptr, arg2); > } > free(arg2); >+ i++; > } >+ if (i == 0) >+ fatal("%s line %d: missing %s specification", >+ filename, linenum, lookup_opcode_name(opcode)); > break; > > case oClearAllForwardings:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 3515
: 3647