Hey guys,
I'm getting an "operation not permitted within namingContext" error when trying to add an entry into a test environment using back-sql. I created the database using the backsql_create.sql,testdb_create.sql,testdb_data.sql, and testdb_metadata.sql files in the OpenLDAP source. I've also tried just using one of the entries in the testdb as a template. Still didn't work. Not sure where the issue is. If you guys can help point me in the right direction that would be awesome.
Thanks!
I'm building using version 2.4.40 on Linux Mint 17. More relevant info:
/etc/odbc.ini:
[openldap] Description = Example for OpenLDAP's back-sql Driver = MySQL Trace = No Database = openldap Servername = localhost UserName = openldap Password = thisisatest ReadOnly = No RowVersioning = No ShowSystemTables = No ShowOidColumn = No FakeOidIndex = No ConnSettings = SOCKET = /var/run/mysqld/mysqld.sock
/etc/odbcinst.ini:
[MySQL] Description = ODBC for MySQL Driver = /usr/lib/odbc/libmyodbc.so FileUsage = 1
/usr/local/openldap/slapd.conf:
include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/cosine.schema include /usr/local/etc/openldap/schema/inetorgperson.schema pidfile /usr/local/var/run/slapd.pid argsfile /usr/local/var/run/slapd.args database sql suffix "dc=example,dc=com" rootdn "cn=root,dc=example,dc=com" rootpw thisisatest dbname openldap dbuser openldap dbpasswd thisisatest subtree_cond "ldap_entries.dn LIKE CONCAT('%',?)" insentry_stmt "INSERT INTO ldap_entries (dn,oc_map_id,parent,keyval) VALUES (?,?,?,?)" has_ldapinfo_dn_ru no
File permissions:
srwxrwxrwx 1 mysql mysql 0 Dec 8 12:22 /var/run/mysqld/mysqld.sock lrwxrwxrwx 1 root root 43 Dec 8 16:25 /usr/lib/odbc/libmyodbc.so -> /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so -r--r--r-- 1 root root 20499 Dec 15 11:52 /usr/local/etc/openldap/schema/core.schema -r--r--r-- 1 root root 73994 Dec 15 11:52 /usr/local/etc/openldap/schema/cosine.schema -r--r--r-- 1 root root 6267 Dec 15 11:52 /usr/local/etc/openldap/schema/inetorgperson.schema -rw-r--r-- 1 openldap openldap 29 Dec 15 12:00 /usr/local/var/run/slapd.args -rw-r--r-- 1 openldap openldap 6 Dec 15 12:00 /usr/local/var/run/slapd.pid
Am Mon, 15 Dec 2014 12:11:37 -0500 schrieb thelastknowngod tlkg.me@gmail.com:
Hey guys,
I'm getting an "operation not permitted within namingContext" error when trying to add an entry into a test environment using back-sql. I created the database using the backsql_create.sql,testdb_create.sql,testdb_data.sql, and testdb_metadata.sql files in the OpenLDAP source. I've also tried just using one of the entries in the testdb as a template. Still didn't work. Not sure where the issue is. If you guys can help point me in the right direction that would be awesome.
namingContext is the buzz word. It seems that your DN you want to create does'nt match the database suffix.
-Dieter
Pretty sure I'm using the right one. The line from slapd.conf is:
suffix "dc=example,dc=com"
The ldif I'm trying to add is pretty simple too:
dn: ou=People,dc=example,dc=com changetype: add objectClass: organizationalUnit ou: People
The same thing happens when adding a person directly under dc=example,dc=com:
dn: cn=USERNAME,dc=example,dc=com changetype: add objectClass: inetOrgPerson givenName: USER sn: NAME cn: USERNAME
Could it be an issue with how the mappings are done in the testdb? I'm also seeing this in the log:
backsql_add("cn=USERNAME,dc=example,dc=com"): create procedure is not defined for structuralObjectClass "inetOrgPerson" - aborting
Thanks for taking a look.
On 12/16/2014 02:12 AM, Dieter Klünter wrote:
Am Mon, 15 Dec 2014 12:11:37 -0500 schrieb thelastknowngod tlkg.me@gmail.com:
Hey guys,
I'm getting an "operation not permitted within namingContext" error when trying to add an entry into a test environment using back-sql. I created the database using the backsql_create.sql,testdb_create.sql,testdb_data.sql, and testdb_metadata.sql files in the OpenLDAP source. I've also tried just using one of the entries in the testdb as a template. Still didn't work. Not sure where the issue is. If you guys can help point me in the right direction that would be awesome.
namingContext is the buzz word. It seems that your DN you want to create does'nt match the database suffix.
-Dieter
Am Tue, 16 Dec 2014 14:21:00 -0500 schrieb thelastknowngod tlkg.me@gmail.com:
Pretty sure I'm using the right one. The line from slapd.conf is:
suffix "dc=example,dc=com"
The ldif I'm trying to add is pretty simple too:
dn: ou=People,dc=example,dc=com changetype: add objectClass: organizationalUnit ou: People
The same thing happens when adding a person directly under dc=example,dc=com:
dn: cn=USERNAME,dc=example,dc=com changetype: add objectClass: inetOrgPerson givenName: USER sn: NAME cn: USERNAME
Could it be an issue with how the mappings are done in the testdb? I'm also seeing this in the log:
backsql_add("cn=USERNAME,dc=example,dc=com"): create procedure is not defined for structuralObjectClass "inetOrgPerson" - aborting
[...]
man slapd-sql(5), section 'statement configuration' and section 'metainformation used'. But you should use sql tools anyhow and write directly to a sql database, as back-sql is primarily for read operations.
-Dieter
openldap-technical@openldap.org