[Date Prev][Date Next] [Chronological] [Thread] [Top]

Back-sql problem (Sybase)



Hello,

I browsed the archives without finding any answer to my problem, so I post here:

I did setup OpenLDAP to use an existing sybase server as a backend.

ODBC wasn't a problem, and sldap.conf seem to be fine but I got this when I do slapd -d 1:

... a lot of log that seem to be fine, if you really need them just ask.

==>backsql_get_db_conn()
==>backsql_open_db_conn()
backsql_open_db_conn: SQLConnect() to database 'GAddress' as user 'GMaster' succeeded with info:
Return code: 1
Native error code: 5704
SQL engine state:
Message: [unixODBC][FreeTDS][SQL Server]Changed client character set setting to 'utf8'.


Native error code: 5701
SQL engine state:
Message: [unixODBC][FreeTDS][SQL Server]Changed database context to 'GMaster'.


Native error code: 5701
SQL engine state:
Message: [unixODBC][FreeTDS][SQL Server]Changed database context to 'GAddress'.


backsql_open_db_conn(): connected, adding to tree
<==backsql_open_db_conn()
backsql_get_db_conn(): first call -- reading schema map
==>load_schema_map()
load_schema_map(): at_query 'SELECT name,sel_expr,from_tbls,join_where,add_proc,delete_proc,param_order,expe ct_return,sel_expr_u FROM ldap_attr_mappings WHERE oc_map_id=?'
load_schema_map(): objectClass 'inetOrgPerson': keytbl='Address' keycol='id'
create_proc=' '
delete_proc=' '
expect_return: add=0, del=0; attributes:
load_schema_map(): autoadding 'objectClass' and 'ref' mappings
load_schema_map(): error executing at_query:
Return code: -1
==>backsql_free_db_conn()
backsql_free_db_conn(): closing db connection
... the rest of the log until slapd stopped.



What I did to configure that:

Setting up odbc, this part seem to work.
Configuring slapd.conf:
# $OpenLDAP: pkg/ldap/servers/slapd/slapd.conf,v 1.23.2.8 2003/05/24 23:19:14 kurt Exp $
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include /opt/OpenLDAP/etc/openldap/schema/core.schema
include /opt/OpenLDAP/etc/openldap/schema/cosine.schema
include /opt/OpenLDAP/etc/openldap/schema/inetorgperson.schema


# Define global ACLs to disable default read access.

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral       ldap://root.openldap.org

pidfile         /opt/OpenLDAP/var/slapd.pid
argsfile        /opt/OpenLDAP/var/slapd.args
defaultsearchbase       dc=goyman,dc=com

threads 32
allow bind_v2

# Load dynamic backend modules:
# modulepath    /opt/OpenLDAP/libexec/openldap
# moduleload    back_bdb.la
# moduleload    back_ldap.la
# moduleload    back_ldbm.la
# moduleload    back_passwd.la
# moduleload    back_shell.la

# Sample security restrictions
#       Require integrity protection (prevent hijacking)
#       Require 112-bit (3DES or better) encryption for updates
#       Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
#       Root DSE: allow anyone to read it
#       Subschema (sub)entry DSE: allow anyone to read it
#       Other DSEs:
#               Allow self write access
#               Allow authenticated users read access
#               Allow anonymous users to authenticate
#       Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
#       by self write
#       by users read
#       by anonymous auth
#
# if no access controls are present, the default policy is:
#       Allow read by all
#
# rootdn can always write!

# sql database def
database sql
suffix "dc=goyman,dc=com"
rootdn "cn=root,dc=goyman,dc=com"
rootpw {SSHA}xxxx
dbname GAddress
dbuser GMaster
dbpasswd XXXXXX
lastmod off
insentry_query "insert into ldap_entries (id,dn,oc_map_id,parent,keyval) values ((select max(id)+1 from ldap_entries),?,?,?,?)"
concat_pattern "?+?"
upper_func "UPPER"
has_ldapinfo_dn_ru no


### END

In sybase db I did create mappings table and I did add one test ocMappings with one test attrMapping:

1> select * from ldap_oc_mappings
2> go
id name keytbl keycol create_proc delete_proc expect_return
1 inetOrgPerson Address id 0


1> select * from ldap_attr_mappings
2> go
id oc_map_id name sel_expr from_tbls join_where add_proc modify_proc delete_proc param_order expect_return sel_expr_u
1 1 cn (Address.firstName + Address.lastName) Address NULL NULL NULL delete from Address where id = ? 3 0 NULL
4 1 sn Address.lastName Address NULL update Address set lastName=? where id=? NULL NULL 3 0 NULL



Other table has been created as well but they are empty.

This is intended to be a readOnly server as all write operation are made directly to the db.

Regards

Goyman

.::.:..: Celui qui appréhende le lendemain mourra idiot .:..:::

				goyman