Bugzilla – Attachment 2951 Details for
Bug 2685
Case sensitive hostname matching
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
make host matching in ssh case insensitive
openssh-ssh_case_insensitive_host_matching.patch (text/plain), 1.53 KB, created by
Petr Cerny [:hrosik]
on 2017-03-02 01:42:50 AEDT
(
hide
)
Description:
make host matching in ssh case insensitive
Filename:
MIME Type:
Creator:
Petr Cerny [:hrosik]
Created:
2017-03-02 01:42:50 AEDT
Size:
1.53 KB
patch
obsolete
>Case insensitive hostname matching in ssh. > >diff --git a/readconf.c b/readconf.c >index e51481b1..c7ba563d 100644 >--- a/readconf.c >+++ b/readconf.c >@@ -550,6 +550,7 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, > const char *filename, int linenum) > { > char *arg, *oattrib, *attrib, *cmd, *cp = *condition, *host, *criteria; >+ char *hostlc; > const char *ruser; > int r, port, this_result, result = 1, attributes = 0, negate; > char thishost[NI_MAXHOST], shorthost[NI_MAXHOST], portstr[NI_MAXSERV]; >@@ -570,6 +571,10 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, > host = xstrdup(host_arg); > } > >+ /* match_hostname() requires the hostname to be lowercase */ >+ hostlc = xstrdup(host); >+ lowercase(hostlc); >+ > debug2("checking match for '%s' host %s originally %s", > cp, host, original_host); > while ((oattrib = attrib = strdelim(&cp)) && *attrib != '\0') { >@@ -608,8 +613,8 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, > goto out; > } > if (strcasecmp(attrib, "host") == 0) { >- criteria = xstrdup(host); >- r = match_hostname(host, arg) == 1; >+ criteria = xstrdup(hostlc); >+ r = match_hostname(hostlc, arg) == 1; > if (r == (negate ? 1 : 0)) > this_result = result = 0; > } else if (strcasecmp(attrib, "originalhost") == 0) { >@@ -682,6 +687,7 @@ match_cfg_line(Options *options, char **condition, struct passwd *pw, > if (result != -1) > debug2("match %sfound", result ? "" : "not "); > *condition = cp; >+ free(hostlc); > free(host); > return result; > }
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
Actions:
View
|
Diff
Attachments on
bug 2685
:
2951
|
2960