View Issue Details

IDProjectCategoryView StatusLast Update
0007706CommunityOCCT:Data Exchangepublic2009-06-24 17:31
ReporterabvAssigned Toabv 
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
OSAll 
Summary0007706: IGES translator accesses DNS without a need
DescriptionThis problem has been reported by Jean-Michel Boulcourt on Forum, see thread 7142:
http://www.opencascade.org/org/forum/thread_7142

------------

...each first time I execute Data Exchange Draw commands, the process tries to
connect to a DNS server to resolve some internet adress.

In fact, if you look at source code "IGESData::Init()", there is a variable
declared "OSD_Host host". Then at looking at the source code of the constructor
of OSD_Host, it makes some stuff (only once per TKernel instance running) in
order to identifies the hostname and its IP adress.

Unfortunately it uses the function "gethostbyname" from the wsock32.lib.

1/ This function returns the IP adress of the host by looking at a host
database. In my case, a computer at home, so generally it will connect to the
DNS server of my ISP, instead of resolving the netbios name.

2/ this method has been deprecated by Microsoft with the introduction of the
getaddrinfo function. see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/gethostbyname_2.asp

3/ Some firewalls blocks the usage of gethostbyname because this function is not
secure and was one of the weakness exploited by Sasser


This explanation may responds to an older message in this forum saying that
OpenCascade was sometimes connecting to the internet while running.

This could easily be corrected quickly by removing the sentence "OSD_Host host"
in "IGESData:Init()" because it is never used (People from OCC will correct me
if I'm wrong).

------------

This gives three possible improvements:

1. The creation of OSD_Host instance in IGESData::Init() should be commented out

2. The implementation of OSD_Host class could be revised to use getaddrinfo()
instead of gethostbyname(). The expected advantage is to avoid security
problems. However, the this may be difficult since documentation on
getaddrinfo() is yet less clear than on gethostbyname() and obviously some
experiments will be needed to figure out how to extract IP address from
information returned by that function.

3. If step 2 is done, then the usage of gethostbyname() function in other parts
of OCC (e.g. in STEPConstruct_AP203Context.cxx) shall be also considered for update
TagsNo tags attached.
Test case number

Attached Files

  • IGESData.cxx (9,425 bytes)

Relationships

related to 0020550 closedepa Open CASCADE Miscellaneous OCC improvements, including improved thread-safety 

Activities

2008-09-29 09:28

 

IGESData.cxx (9,425 bytes)

Issue History

Date Modified Username Field Change
2008-09-12 13:48 bugmaster Status closed => assigned
2008-09-12 13:48 bugmaster Resolution suspended => @0@
2008-09-12 13:50 bugmaster Assigned To bugmaster => pdn
2008-09-18 11:24 pdn Assigned To pdn => epa
2008-10-23 15:26 epa BugsThisDependsOn => 20550
2009-06-16 13:21 bugmaster Assigned To epa => abv
2009-06-24 19:31 bugmaster Status assigned => closed
2009-06-24 19:31 bugmaster Resolution @0@ => fixed
2011-08-02 11:12 bugmaster Category OCCT:DTE => OCCT:Data Exchange