Commit ef7ddb7f authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Merge from branch 02_00_00 (163128:164117)

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/trunk@165531 ae0415b3-e90b-0410-900d-d0be9363c56b
parents dcfd8b57 0fa0ffb5
......@@ -12,6 +12,13 @@ if ! $(lce-root-path)
}
use-project lce : $(lce-root-path) ;
local lualdap-root-path = [ os.environ LUALDAP_ROOT_PATH ] ;
if ! $(lualdap-root-path)
{
lualdap-root-path = "$(here)/../lualdap" ;
}
use-project lualdap : $(lualdap-root-path) ;
lua-install-path = [ os.environ LUA_INSTALL_PATH ] ;
if ! $(lua-install-path)
{
......@@ -67,7 +74,7 @@ project busservices
<target-os>windows:<define>_CRT_SECURE_NO_WARNINGS
<target-os>windows:<define>_WIN32
<define>OPENBUS_PROGNAME=\\\""busservices\\\""
<target-os>windows:<cxxflags>/FS
<toolset>msvc-12.0:<cxxflags>/FS
<debug-symbols>on
;
......@@ -131,8 +138,10 @@ exe busservices
<dependency>/loop//luacothread
<dependency>/oil//oil
<dependency>/oil//luaidl
<dependency>/lce//lce
<dependency>/luascs//luascs
<dependency>/luaopenbus//luaopenbus
<target-os>linux:<library>/lualdap//lualdap
<target-os>linux:<library>/unix//dl
<target-os>linux:<library>/unix//pthread
<target-os>darwin:<library>/lualdap//lualdap
......
......@@ -19,6 +19,9 @@ local type = _G.type
local array = require "table"
local concat = array.concat
local os = require "os"
local tmpname = os.tmpname
local thread = require "openbus.util.thread"
local spawn = thread.spawn
......@@ -39,6 +42,7 @@ return function(configs)
return nil, msg.LdapBadTimeout:tag{value=timeout,type=type(timeout)}
end
local cleartext = configs.ldap_cleartext
local iorpath = configs.ldap_iorpath or tmpname()
-- collect server urls
local urls = {}
for _, url in ipairs(servers) do
......@@ -68,7 +72,7 @@ return function(configs)
flavor = "cooperative.server;corba.server",
host = "127.0.0.1",
}
oil.writeto("ldap.ior", orb:newservant{
oil.writeto("]=]..iorpath..[=[", orb:newservant{
__type = orb:loadidl[[]=]..idl..[=[]],
validate = function(_, url, dn, password, usetls, timeout)
if timeout == -1 then timeout = nil end
......@@ -92,13 +96,13 @@ return function(configs)
orb:loadidl(idl)
local service
repeat
local ior = oil.readfrom("ldap.ior")
local ior = oil.readfrom(iorpath)
if ior ~= nil then
local ok, res = pcall(orb.newproxy, orb, ior, nil, "LDAP")
if ok then service = res end
end
until service ~= nil
os.remove("ldap.ior")
os.remove(iorpath)
function openldap(url, dn, password, usetls, timeout)
return service:validate(url, dn, password, usetls, timeout or -1)
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment