Red_Hat_Directory_Server-9.0-Plug-in_Guide-en-US.pdf

(3698 KB) Pobierz
Red Hat D irectory Server 9.0 Plug-in Guide
1
Red Hat Directory Server 9.0
Plug-in Guide
for programmers
Edition 9.0.1
Copyright © 2011 Red Hat, Inc.
2
Legal Notice
Legal Notice
Copyright © 2011 Red Hat, Inc..
T he text of and illustrations in this document are licensed by Red Hat under a Creative Commons
Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at
http://creativecommons.org/licenses/by-sa/3.0/.
In accordance with CC-BY-SA, if you distribute this
document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section
4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo,
and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus T orvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States
and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other
countries.
All other trademarks are the property of their respective owners.
1801 Varsity Drive
Raleigh, NC 27606-2072 USA
Phone: +1 919 754 3700
Phone: 888 733 4281
Fax: +1 919 754 3701
December 6, 2011, updated June 25, 2012
Table of Contents
Preface
1. Required Concepts
2. Examples and Formatting
3. Additional Reading
4. Giving Feedback
5. Documentation History
I. Introduction to Directory Server Plug-ins
1. An Overview of Directory Server Plug-ins
1.1. About Directory Server Plug-ins
1.2. How Directory Server Plug-ins Work
1.3. T ypes of Directory Server Plug-ins
1.4. Using Directory Server Plug-in APIs
1.5. Deprecated Functions and Replacements
2. Writing and Compiling Plug-ins
2.1. Writing a Plug-in Function
2.2. Writing Plug-in Initialization Functions
2.3. Compiling a Directory Server Plug-in
3. Configuring Plug-ins
3.1. Creating a Plug-in Configuration File
3.2. Loading the Plug-in Configuration File
3.3. Passing Extra Arguments to Plug-ins
3.4. Setting the Log Level of the Server
4. An Example Plug-in
4.1. Writing the Plug-in Example
Red Hat D irectory Server 9.0 Plug-in Guide
3
4.2. Compiling the Plug-in Example
4.3. Registering the Plug-in
4.4. Running the Plug-in
II. Writing Functions and Plug-ins
5. Frontend API Functions
5.1. Logging Messages
5.2. Adding Notes to Access Log Entries
5.3. Sending Data to the Client
5.4. Determining If an Operation Was Abandoned
5.5. Working with Entries, Attributes, and Values
5.6. Working with DNs and RDNs
5.7. Working with Search Filters
5.8. Checking Passwords
6. Writing Pre- and Post-operation Plug-ins
6.1. How Pre- and Post-operation Plug-ins Work
6.2. T ypes of Pre-operation and Post-operation Functions
6.3. Using Plug-in Configuration Information in Preop Plug-ins
6.4. Registering Pre- and Post-operation Functions
7. Defining Functions for LDAP Operations
7.1. Specifying Start and Close Functions
7.2. Processing an LDAP Bind Operation
7.3. Processing an LDAP Unbind Operation
7.4. Processing an LDAP Search Operation
7.5. Processing an LDAP Compare Operation
7.6. Processing an LDAP Add Operation
7.7. Processing an LDAP Modify Operation
7.8. Processing an LDAP Modify RDN Operation
7.9. Processing an LDAP Delete Operation
7.10. Processing an LDAP Abandon Operation
8. Defining Functions for Authentication
8.1. Understanding Authentication Methods
8.2. How the Directory Server Identifies Clients
8.3. How the Authentication Process Works
8.4. Writing Your Own Authentication Plug-in
8.5. Writing a Pre-Operation Bind Plug-in
9. Writing Entry Store/Fetch Plug-ins
9.1. How Entry Store/Fetch Plug-ins Work
9.2. Writing Entry Store/Fetch Functions
9.3. Registering Entry Store/Fetch Functions
10. Writing Extended Operation Plug-ins
10.1. How Extended Operation Plug-ins Work
10.2. Writing Extended Operation Functions
10.3. Registering Extended Operation Functions
10.4. Specifying Start and Close Functions
11. Writing Matching Rule Plug-ins
11.1. Understanding Matching Rules
11.2. Understanding Matching Rule Plug-ins
11.3. Indexing Based on Matching Rules
11.4. Handling Extensible Match Filters
11.5. Handling Sorting by Matching Rules
11.6. Writing a Destructor Function
11.7. Writing an Initialization Function
11.8. Registering Matching Rule Functions
11.9. Specifying Start and Close Functions
12. Using the Custom Distribution Logic
12.1. About Distributing Flat Namespaces
12.2. Creating a Distribution Function
4
Legal Notice
12.3. Adding the Distribution Function to Your Directory
12.4. Using the Distribution Logic Examples
12.5. Custom Distribution Checklist
13. Using Data Interoperability Plug-ins
13.1. Installing Directory Server
13.2. Enabling the DIOP Feature in Directory Server
13.3. Using the DIOP Feature
13.4. Sample DIOP Plug-in
13.5. Plug-in API Reference
III. Data T ype and Structure Reference
14. Data T ype and Structure Reference
14.1. berval
14.2. computed_attr_context
14.3. LDAPControl
14.4. LDAPMod
14.5. mrFilterMatchFn
14.6. plugin_referral_entry_callback
14.7. plugin_result_callback
14.8. plugin_search_entry_callback
14.9. send_ldap_referral_fn_ptr_t
14.10. send_ldap_result_fn_ptr_t
14.11. send_ldap_search_entry_fn_ptr_t
14.12. Slapi_Attr
14.13. Slapi_Backend
14.14. slapi_backend_state_change_fnptr
14.15. Slapi_ComponentID
14.16. slapi_compute_callback_t
14.17. slapi_compute_output_t
14.18. Slapi_Connection
14.19. Slapi_CondVar
14.20. Slapi_Counter
14.21. Slapi_DN
14.22. Slapi_Entry
14.23. Slapi_Filter
14.24. Slapi_MatchingRuleEntry
14.25. Slapi_Mod
14.26. Slapi_Mods
14.27. Slapi_Mutex
14.28. Slapi_Operation
14.29. Slapi_PBlock
14.30. Slapi_PluginDesc
14.31. Slapi_RDN
14.32. Slapi_T ask
14.33. Slapi_UniqueID
14.34. Slapi_Value
14.35. Slapi_ValueSet
14.36. Replication Session Hooks Callbacks
14.37. Synchronization Callbacks and Data T ypes
IV. Function Reference
15. Distribution Routines
15.1. distribution_plugin_entry_point()
16. Functions for Access Control
16.1. slapi_access_allowed()
16.2. slapi_acl_check_mods()
16.3. slapi_acl_verify_aci_syntax()
17. Functions for Internal Operations and Plug-in Callback
17.1. slapi_add_internal_pb()
17.2. slapi_delete_internal_pb()
17.3. slapi_free_search_results_internal()
Red Hat D irectory Server 9.0 Plug-in Guide
5
17.4. slapi_modify_internal_pb()
17.5. slapi_modrdn_internal_pb()
17.6. slapi_search_internal_callback_pb()
17.7. slapi_search_internal_get_entry()
17.8. slapi_search_internal_pb()
18. Functions for Setting Internal Operation Flags
18.1. slapi_add_entry_internal_set_pb()
18.2. slapi_add_internal_set_pb()
18.3. slapi_delete_internal_set_pb()
18.4. slapi_modify_internal_set_pb()
18.5. slapi_rename_internal_set_pb()
18.6. slapi_search_internal_set_pb()
18.7. slapi_seq_internal_callback_pb()
18.8. slapi_seq_internal_set_pb()
19. Functions for Handling Attributes
19.1. slapi_attr_add_value()
19.2. slapi_attr_basetype()
19.3. slapi_attr_dup()
19.4. slapi_attr_first_value()
19.5. slapi_attr_flag_is_set()
19.6. slapi_attr_free()
19.7. slapi_attr_get_bervals_copy()
19.8. slapi_attr_get_flags()
19.9. slapi_attr_get_numvalues()
19.10. slapi_attr_get_oid_copy()
19.11. slapi_attr_get_type()
19.12. slapi_attr_get_valueset()
19.13. slapi_attr_init()
19.14. slapi_attr_new()
19.15. slapi_attr_next_value()
19.16. slapi_attr_set_valueset()
19.17. slapi_attr_syntax_normalize()
19.18. slapi_attr_type2plugin()
19.19. slapi_attr_type_cmp()
19.20. slapi_attr_types_equivalent()
19.21. slapi_attr_value_cmp()
19.22. slapi_attr_value_find()
19.23. slapi_valueset_set_from_smod()
20. Functions for Managing Backend Operations
20.1. slapi_be_addsuffix()
20.2. slapi_be_delete_onexit()
20.3. slapi_be_exist()
20.4. slapi_be_free()
20.5. slapi_be_get_instance_info()
20.6. slapi_be_get_name()
20.7. slapi_be_get_readonly()
20.8. slapi_be_getentrypoint()
20.9. slapi_be_getsuffix()
20.10. slapi_be_gettype()
20.11. slapi_be_is_flag_set()
20.12. slapi_be_issuffix()
20.13. slapi_be_logchanges()
20.14. slapi_be_new()
20.15. slapi_be_private()
20.16. slapi_be_select()
20.17. slapi_be_select_by_instance_name()
20.18. slapi_be_set_flag()
20.19. slapi_be_set_instance_info()
20.20. slapi_be_set_readonly()
20.21. slapi_be_setentrypoint()
20.22. slapi_get_first_backend()
20.23. slapi_get_first_suffix()
Zgłoś jeśli naruszono regulamin