Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 74545 Details for
Bug 164539
AC blocks connecction from local host if local host is allowed by name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
patch_164539.txt (text/plain), 2.96 KB, created by
Igor Alelekov
on 2007-07-25 06:49:15 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Igor Alelekov
Created:
2007-07-25 06:49:15 EDT
Size:
2.96 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.agentcontroller >Index: src-native-new/src/transport/transportSupport/TransportSupport.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/transportSupport/TransportSupport.c,v >retrieving revision 1.16 >diff -u -r1.16 TransportSupport.c >--- src-native-new/src/transport/transportSupport/TransportSupport.c 2 Nov 2006 18:58:08 -0000 1.16 >+++ src-native-new/src/transport/transportSupport/TransportSupport.c 25 Jul 2007 10:38:49 -0000 >@@ -399,8 +399,40 @@ > return 0; > } > >-BOOL tptp_checkHost(network_list_t *list, unsigned char *address) { >+int isLocalHost(char* name) { >+ tptp_IPAddresses_t localAddresses; >+ struct hostent *he; >+ unsigned char *addr, *cur; >+ int len, res; >+ >+ if (name == NULL) return 0; >+ >+ he = gethostbyname(name); >+ if (he == NULL || he->h_addr_list == NULL || he->h_addr_list[0] == '\0') return 0; >+ >+ addr = he->h_addr_list[0]; >+ >+ if(tptp_getLocalIPAddresses(&localAddresses) != 0) return 0; >+ >+ res = 0; >+ len = localAddresses.addressLength; >+ cur = localAddresses.addresses; >+ >+ while(*cur) { >+ if(cur[0]==addr[0] && cur[1]==addr[1] && cur[2]==addr[2] && cur[3] == addr[3]) { >+ res = 1; >+ break; >+ } > >+ cur+=len; >+ } >+ >+ tptp_free(localAddresses.addresses); >+ >+ return res; >+} >+ >+BOOL tptp_checkHost(network_list_t *list, unsigned char *address) { > network_list_node_t *current; > > //If the list or host address is not specified then return TRUE. >@@ -420,6 +452,7 @@ > tptp_IPAddresses_t localAddresses; > network_t *entry=current->entry; > /* Is this an allow rule */ >+ > switch(entry->wildcard) { > case TPTP_HW_ALL: > if(entry->allow) { >@@ -480,6 +513,12 @@ > /* 1 hostent structure per thread, */ > struct hostent *hostentTemp; > >+ /* Resolve the listed IP address in the config file */ >+ hostentTemp = gethostbyname(entry->hostname); >+ if(hostentTemp != NULL) { >+ strcpy(hostnameAllowed, hostentTemp->h_name); >+ } >+ > /* Resolve the remote host IP address */ > hostentTemp = gethostbyaddr((char*)address, 4 * sizeof(char), AF_INET); > >@@ -488,12 +527,6 @@ > aliases = *(hostentTemp->h_aliases); /* Check the aliases */ > } > >- /* Resolve the listed IP address in the config file */ >- hostentTemp = gethostbyname(entry->hostname); >- if(hostentTemp != NULL) { >- strcpy(hostnameAllowed, hostentTemp->h_name); >- } >- > /* First, check the hostname, if identical, check if it is set to ALLOW */ > if(strcasecmp(hostnameEntry, hostnameAllowed)==0) { > if(entry->allow) { >@@ -512,10 +545,15 @@ > } > aliases+=sizeof(char*); > } >+ >+ if (isLocalHost(hostnameAllowed) && isLocalHost(hostnameEntry)) { >+ return entry->allow ? TRUE : FALSE; >+ } > } > break; > } > current=current->next; > } >+ > return FALSE; > }
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 164539
: 74545