The Samba-Bugzilla – Attachment 2961 Details for
Bug 5067
hosts allow - Forward Host Name Lookup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to 2.6.9 to allow forward host name lookup as described
HostNameLookup.patch (text/plain), 1.27 KB, created by
Paul Williamson
on 2007-11-09 23:06:00 UTC
(
hide
)
Description:
Patch to 2.6.9 to allow forward host name lookup as described
Filename:
MIME Type:
Creator:
Paul Williamson
Created:
2007-11-09 23:06:00 UTC
Size:
1.27 KB
patch
obsolete
>--- access_old.c 2007-11-10 15:47:51.644148816 +1100 >+++ access.c 2007-11-10 15:51:49.369009144 +1100 >@@ -211,6 +211,46 @@ static int match_address(char *addr, cha > return ret; > } > >+static int match_hostlookup(char *addr, char *tok) >+{ >+ struct hostent *hp; >+ char *p; >+ unsigned int len; >+ >+ >+ p = strchr(tok,'/'); >+ if (p) { >+ *p = '\0'; >+ len = p - tok; >+ } else >+ len = strlen(tok); >+ >+ /* Fail quietly if tok is a an address) */ >+ if (strspn(tok, ".0123456789") != len >+#ifdef INET6 >+ && strchr(tok, ':') == NULL >+#endif >+ ) >+ ; >+ else { >+ return 0; >+ } >+ >+ hp = gethostbyname(tok); >+ if (hp == NULL) { >+ return 0; >+ } else { >+ unsigned int i; >+ for (i=0; hp -> h_addr_list[i] != NULL; i++) { >+ char *tok = inet_ntoa( *( struct in_addr*)( hp -> h_addr_list[i])); >+ if (match_address(addr, tok)) >+ return 1; >+ } >+ } >+ return 0; >+} >+ >+ > static int access_match(char *list, char *addr, char *host) > { > char *tok; >@@ -224,7 +264,7 @@ static int access_match(char *list, char > strlower(host); > > for (tok = strtok(list2, " ,\t"); tok; tok = strtok(NULL, " ,\t")) { >- if (match_hostname(host, tok) || match_address(addr, tok)) { >+ if (match_hostname(host, tok) || match_address(addr, tok) || match_hostlookup(addr, tok)) { > free(list2); > return 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
Actions:
View
Attachments on
bug 5067
: 2961