ldb_search returns LDB_ERR_NO_SUCH_OBJECT when searching for prefixMap from module

Anatoliy Atanasov anatoliy.atanasov at postpath.com
Tue Jun 24 13:17:26 GMT 2008


Hi Andrew,

I had some troubles with internet connection, meanwhile I did some tests.

> Could you post that as a diff -u?  Say with 'git diff'?
It doesn't work for files that are just added to git index.

> I tried to copy/paste the code from schema_fsmo_init method and it doesn't work in my function also.
> I guess my module is not called when it should.
It was a location issue.
I tried to edit the .\scripting\python\samba\provision.py and to move the prefix_map module after the schema_fsmo module and now it ldb_search works fine.

Here is the diff for build and provision, I hope its in the right place now:

diff --git a/source/dsdb/samdb/ldb_modules/config.mk b/source/dsdb/samdb/ldb_modules/config.mk
index 388b67c..31a87de 100644
--- a/source/dsdb/samdb/ldb_modules/config.mk
+++ b/source/dsdb/samdb/ldb_modules/config.mk
@@ -343,3 +343,17 @@ SUBSYSTEM = LIBLDB

 ldb_instancetype_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/instancetype.o

+################################################
+# Start MODULE ldb_prefix_map
+[MODULE::ldb_prefix_map]
+INIT_FUNCTION = LDB_MODULE(prefix_map)
+CFLAGS = -Ilib/ldb/include
+OUTPUT_TYPE = SHARED_LIBRARY
+PRIVATE_DEPENDENCIES = SAMDB LIBTALLOC LIBNDR NDR_MISC NDR_DRSUAPI \
+                                          NDR_DRSBLOBS
+SUBSYSTEM = LIBLDB
+# End MODULE ldb_prefix_map
+################################################
+
+ldb_prefix_map_OBJ_FILES = $(dsdbsrcdir)/samdb/ldb_modules/prefix_map.o
+
diff --git a/source/scripting/python/samba/provision.py b/source/scripting/python/samba/provision.py
index 3f936c3..3cb27c2 100644
--- a/source/scripting/python/samba/provision.py
+++ b/source/scripting/python/samba/provision.py
@@ -523,7 +523,7 @@ def setup_samdb_partitions(samdb_path, setup_path, message, lp, session_info,
                 "CONFIGDN_LDB": configdn_ldb,
                 "DOMAINDN": names.domaindn,
                 "DOMAINDN_LDB": domaindn_ldb,
-                "SCHEMADN_MOD": "schema_fsmo,instancetype",
+                "SCHEMADN_MOD": "schema_fsmo,prefix_map,instancetype",
                 "CONFIGDN_MOD": "naming_fsmo,instancetype",
                 "DOMAINDN_MOD": "pdc_fsmo,password_hash,instancetype",
                 "MODULES_LIST": ",".join(modules_list),

Thanks,
Anatoliy

-----Original Message-----
From: Andrew Bartlett [mailto:abartlet at samba.org] 
Sent: Tuesday, June 24, 2008 13:45
To: Anatoliy Atanasov
Cc: samba-technical at lists.samba.org
Subject: Re: ldb_search returns LDB_ERR_NO_SUCH_OBJECT when searching for prefixMap from module

On Tue, 2008-06-24 at 13:15 +0300, Anatoliy Atanasov wrote:
> Hi List, 
> 
> I added a module in dsdb/samdb/ldb_modules called prefix_map. All I need in my init function is to get the prefix map and store it, 
> but I fail when I do ldb_search with error LDB_ERR_NO_SUCH_OBJECT.
> I tried to copy/paste the code from schema_fsmo_init method and it doesn't work in my function also.
> I guess my module is not called when it should.
> 
> Here is what I have done so far.

Could you post that as a diff -u?  Say with 'git diff'?

That way, I can try out the code, and give you more useful feedback.
(it should also be easier than hand-composing it into a mail :-)

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prefix_map.c
Type: application/octet-stream
Size: 4521 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20080624/2b3b5584/prefix_map.obj


More information about the samba-technical mailing list