The Samba-Bugzilla – Attachment 12024 Details for
Bug 11875
nss_wins plugin does not fill hostent structure correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.4
nss_wins.patch (text/plain), 2.44 KB, created by
Andreas Schneider
on 2016-04-26 10:52:03 UTC
(
hide
)
Description:
patch for 4.4
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2016-04-26 10:52:03 UTC
Size:
2.44 KB
patch
obsolete
>From 9b9a3d6b04a1667751248545b63c192f3ce69f9b Mon Sep 17 00:00:00 2001 >From: Tom Mortensen <tomm@lime-technology.com> >Date: Sat, 16 Apr 2016 10:57:12 +0200 >Subject: [PATCH 1/2] nss_wins: ip_pton expects the raw IP address > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11875 > >Signed-off-by: Tom Mortensen <tomm@lime-technology.com> >Reviewed-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >(cherry picked from commit d3569ca2711d21ac87ff539662333ad315a2a618) >--- > nsswitch/wins.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/nsswitch/wins.c b/nsswitch/wins.c >index 3243ffb..22524e4 100644 >--- a/nsswitch/wins.c >+++ b/nsswitch/wins.c >@@ -47,7 +47,7 @@ NSS_STATUS _nss_wins_gethostbyname2_r(const char *name, int af, struct hostent * > static char *lookup_byname_backend(const char *name) > { > const char *p; >- char *ip; >+ char *ip, *ipp; > size_t nbt_len; > wbcErr result; > >@@ -65,6 +65,11 @@ static char *lookup_byname_backend(const char *name) > return NULL; > } > >+ ipp = strchr(ip, '\t'); >+ if (ipp != NULL) { >+ *ipp = '\0'; >+ } >+ > return ip; > } > >-- >2.8.1 > > >From e8b76fa508dca1098a780841db5f27d45062e8d4 Mon Sep 17 00:00:00 2001 >From: Tom Mortensen <tomm@lime-technology.com> >Date: Sat, 16 Apr 2016 10:57:12 +0200 >Subject: [PATCH 2/2] nss_wins: Fix the hostent setup > >This can never have been tested.... > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11875 > >Signed-off-by: Tom Mortensen <tomm@lime-technology.com> >Reviewed-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >(cherry picked from commit 0b1f4db325bb0ed9171619c874908ee25327bba9) >--- > nsswitch/wins.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/nsswitch/wins.c b/nsswitch/wins.c >index 22524e4..fc65c03 100644 >--- a/nsswitch/wins.c >+++ b/nsswitch/wins.c >@@ -280,7 +280,7 @@ _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he, > } > > if ((he->h_addr_list = (char **)get_static( >- &buffer, &buflen, i * sizeof(char *))) == NULL) { >+ &buffer, &buflen, 2 * sizeof(char *))) == NULL) { > nss_status = NSS_STATUS_TRYAGAIN; > goto out; > } >@@ -291,9 +291,9 @@ _nss_wins_gethostbyname_r(const char *hostname, struct hostent *he, > goto out; > } > >- memcpy(he->h_addr_list[i], &in, INADDRSZ); >+ memcpy(he->h_addr_list[0], &in, INADDRSZ); > >- he->h_addr_list[0] = NULL; >+ he->h_addr_list[1] = NULL; > > /* Set h_addr_type and h_length */ > >-- >2.8.1 >
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 Raw
Flags:
vl
:
review+
jra
:
review+
Actions:
View
Attachments on
bug 11875
: 12024