mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
Generate a unique session ID by using socket.gethostname() instead of socket.gethostbyname(), since the latter one could make bindctl stall if its own host name can't be resolved.(the patch was created by Jinmei and reviewed by zhanglikun)
git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2096 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
53. [bug] zhanglikun
|
||||||
|
bin/bindctl: Generate a unique session ID by using
|
||||||
|
socket.gethostname() instead of socket.gethostbyname(),
|
||||||
|
since the latter one could make bindctl stall if its own
|
||||||
|
host name can't be resolved.
|
||||||
|
(Trac #228, svn r2096)
|
||||||
|
|
||||||
52. [func] zhanglikun
|
52. [func] zhanglikun
|
||||||
bin/xfrout: When xfrout is launched, check whether the
|
bin/xfrout: When xfrout is launched, check whether the
|
||||||
socket file is being used by one running xfrout process,
|
socket file is being used by one running xfrout process,
|
||||||
|
@@ -87,8 +87,8 @@ class BindCmdInterpreter(Cmd):
|
|||||||
'''Generate one session id for the connection. '''
|
'''Generate one session id for the connection. '''
|
||||||
rand = os.urandom(16)
|
rand = os.urandom(16)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
ip = socket.gethostbyname(socket.gethostname())
|
session_id = sha1(("%s%s%s" %(rand, now,
|
||||||
session_id = sha1(("%s%s%s" %(rand, now, ip)).encode())
|
socket.gethostname())).encode())
|
||||||
digest = session_id.hexdigest()
|
digest = session_id.hexdigest()
|
||||||
return digest
|
return digest
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user