Bugzilla – Attachment 3231 Details for
Bug 2335
Config parser accepts ip/port in ListenAddress and PermitOpen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
remove support for obsolete host/port notation
openssh-port-slash.patch (text/plain), 2.69 KB, created by
Darren Tucker
on 2019-01-23 21:46:09 AEDT
(
hide
)
Description:
remove support for obsolete host/port notation
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2019-01-23 21:46:09 AEDT
Size:
2.69 KB
patch
obsolete
>Index: misc.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.c,v >retrieving revision 1.136 >diff -u -p -r1.136 misc.c >--- misc.c 27 Dec 2018 03:25:25 -0000 1.136 >+++ misc.c 23 Jan 2019 10:44:04 -0000 >@@ -531,7 +531,7 @@ put_host_port(const char *host, u_short > * The delimiter char, if present, is stored in delim. > * If this is the last field, *cp is set to NULL. > */ >-static char * >+char * > hpdelim2(char **cp, char *delim) > { > char *s, *old; >Index: misc.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.h,v >retrieving revision 1.78 >diff -u -p -r1.78 misc.h >--- misc.h 27 Dec 2018 03:25:25 -0000 1.78 >+++ misc.h 23 Jan 2019 10:44:04 -0000 >@@ -57,6 +57,7 @@ int timeout_connect(int, const struct s > int a2port(const char *); > int a2tun(const char *, int *); > char *put_host_port(const char *, u_short); >+char *hpdelim2(char **, char *); > char *hpdelim(char **); > char *cleanhostname(char *); > char *colon(char *); >Index: servconf.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/servconf.c,v >retrieving revision 1.346 >diff -u -p -r1.346 servconf.c >--- servconf.c 19 Jan 2019 21:37:48 -0000 1.346 >+++ servconf.c 23 Jan 2019 10:44:04 -0000 >@@ -821,7 +821,7 @@ process_permitopen_list(struct ssh *ssh, > { > u_int i; > int port; >- char *host, *arg, *oarg; >+ char *host, *arg, *oarg, ch; > int where = opcode == sPermitOpen ? FORWARD_LOCAL : FORWARD_REMOTE; > const char *what = lookup_opcode_name(opcode); > >@@ -839,8 +839,8 @@ process_permitopen_list(struct ssh *ssh, > /* Otherwise treat it as a list of permitted host:port */ > for (i = 0; i < num_opens; i++) { > oarg = arg = xstrdup(opens[i]); >- host = hpdelim(&arg); >- if (host == NULL) >+ host = hpdelim2(&arg, &ch); >+ if (host == NULL || ch == '/') > fatal("%s: missing host in %s", __func__, what); > host = cleanhostname(host); > if (arg == NULL || ((port = permitopen_port(arg)) < 0)) >@@ -1251,8 +1251,10 @@ process_server_config_line(ServerOptions > port = 0; > p = arg; > } else { >- p = hpdelim(&arg); >- if (p == NULL) >+ char ch; >+ arg2 = NULL; >+ p = hpdelim2(&arg, &ch); >+ if (p == NULL || ch == '/') > fatal("%s line %d: bad address:port usage", > filename, linenum); > p = cleanhostname(p); >@@ -1879,9 +1881,11 @@ process_server_config_line(ServerOptions > */ > xasprintf(&arg2, "*:%s", arg); > } else { >+ char ch; >+ > arg2 = xstrdup(arg); >- p = hpdelim(&arg); >- if (p == NULL) { >+ p = hpdelim2(&arg, &ch); >+ if (p == NULL || ch == '/') { > fatal("%s line %d: missing host in %s", > filename, linenum, > lookup_opcode_name(opcode));
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:
djm
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2335
:
2525
|
3137
| 3231