Issue 3429 - Contrib : automatic schema download
Summary: Contrib : automatic schema download
Status: UNCONFIRMED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: contrib (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-09 11:22 UTC by Raphael Ouazana
Modified: 2014-08-01 21:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Raphael Ouazana 2004-12-09 11:22:06 UTC
Full_Name: Raphael Ouazana
Version: 2.2.6
OS: Linux
URL: ftp://ftp.openldap.org/incoming/raphael-ouazana-041209-patchDownloadSchema-2.2.6-1.6.patch
Submission from: (NULL) (194.98.7.155)



As discussed in openldap-software, this is a patch to download the schema of a
remote LDAP server. It should work with at least with OpenLDAP 2.1, 2.2 and Sun
Directory 4.16 and 5.2.

I post it mainly to discuss for the moment, as it is not based on HEAD.
But if you wish to integrate it like this, feel free :)

TODO (at least) :
2.2.6 -> HEAD
Translate comments from french to english
Extended operation to reload the schema

Legal notice :
This patch file is derived from OpenLDAP Software. All of the modifications to
OpenLDAP Software represented in this following patch were developed by Raphael
Ouazana raphael.ouazana@linagora.com. These modifications are not subject to any
license of Linagora.

The attached modifications to OpenLDAP Software are subject to the following
notice:
Copyright 2004 Raphael Ouazana
Redistribution and use in source and binary forms, with or without modification,
are permitted only as authorized by the OpenLDAP Public License. 

Comment 1 ando@openldap.org 2004-12-09 13:58:11 UTC
Raphael,

I think your patch is really well contained, and can be of use to many
people.  My suggestion is to rearrange it as a dynamically loadable
module; then all one needs to do is load it __after__ all schema reading
(including loading those backends, modules and overlays that register
schema items of their own).  This would greatly simplify its use, and
eliminate any merging problem with the main branch.  You may move the
config options to a list of args preceded by their name, much like in the
replica/syncrepl statements, e.g.

moduleload downloadschema.so
        uri=ldap://remote:389
        binddn=cn=someone
        bindpw=secret
        ignore-unknown-syntaxes=yes

One point I caught by quickly surfing your code is that you install very
plain generic routines for processing unknown items.  I think a better
approach would be to use those of the "undefined" attributeType, that you
find in slap_schema.si_at_undefined; it used to refer to the
distinguishedName syntax, but recently, in HEAD, it was pointed to
octetString, which is very neutral and may serve your purpose.  I'd also
add the possibility to ignore attributeTypes with undefined syntaxes.

If you develop it as a module, I think we can host it in
contrib/slapd-modules.  I note the directory
contrib/slapd-modules/dsaschema already contains a module that reads
schema files; I don't see much difference from directly including those
files in slapd.conf, but I might be missing something.  You may follow
that as a guideline; your module would add some value by performing the
operation via LDAP.

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497

Comment 2 ando@openldap.org 2004-12-09 14:02:45 UTC
changed notes
moved from Incoming to Contrib
Comment 3 Raphael Ouazana 2004-12-10 16:47:05 UTC
Thank you for your comments. I'll try to do it as soon as I have a
little time...

Do you know if it is possible to download HEAD without CVS access ?

Raphael Ouazana.

Comment 4 ando@openldap.org 2004-12-10 17:48:09 UTC
>
> Thank you for your comments. I'll try to do it as soon as I have a
> little time...
>
> Do you know if it is possible to download HEAD without CVS access ?

Since all you need is a couple of files, you can use
http://www.openldap.org/devel/cvsweb.cgi

p.

-- 
Pierangelo Masarati
mailto:pierangelo.masarati@sys-net.it


    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497

Comment 5 Raphael Ouazana 2005-01-28 16:46:23 UTC
Hi,

You can find the following files :
ftp://ftp.openldap.org/incoming/raphael-ouazana-040128-downloadschema.c
ftp://ftp.openldap.org/incoming/raphael-ouazana-040128-README

The code has been tested with OpenLDAP 2.2.23 because I can't download HEAD.
It seems to work with 2.3.0-alpha too although there are some warnings
(ldap_search_s is deprecated ?).

Raphael Ouazana.

Comment 6 ando@openldap.org 2005-01-29 09:26:19 UTC
changed notes
Comment 7 Howard Chu 2007-12-15 03:29:55 UTC
I was looking at this code in relation to current HEAD/RE24, and things have 
changed quite a bit. Given the ability to dynamically load schema into 
cn=config, is there still a need for this module? (It is in fact the changes 
made for dynamic schema manipulation in slapd that causes the compatibility 
issues with this module.)
-- 
   -- Howard Chu
   Chief Architect, Symas Corp.  http://www.symas.com
   Director, Highland Sun        http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP     http://www.openldap.org/project/

Comment 8 Raphael Ouazana 2007-12-20 14:13:09 UTC
Hi,

Le Sam 15 décembre 2007 04:31, hyc@symas.com a écrit :
> I was looking at this code in relation to current HEAD/RE24, and things
have
> changed quite a bit. Given the ability to dynamically load schema into
cn=config, is there still a need for this module? (It is in fact the
changes
> made for dynamic schema manipulation in slapd that causes the
> compatibility
> issues with this module.)

I don't use this module anymore.  Dynamic schema loading would be useful
to replace it by allowing replication of schema.
In fact I see only a case where the module is still useful: when I want to
get automatically the schema of some directory which is not very
respectful of LDAP standards, for example by providing attributes without
OID.

Regards,
Raphaël Ouazana.



Comment 9 OpenLDAP project 2014-08-01 21:03:26 UTC
candidate to contrib/slapd-modules
module patch under review