logo_kerberos.gif

Samba4 Port: hdb & ldb Interfaces

From K5Wiki
Revision as of 19:13, 12 September 2009 by Don (talk | contribs) (Heimdal's hdb Interface to Samba4's LDB)

Jump to: navigation, search

This page aims to reduce the confusion about

  1. Two hdb libraries (one each for Samba4 & Heimdal);
  2. Samba4's LDB library, and
  3. Samba4's ldb library.

Heimdal's hdb Interface to Samba4's LDB

Samba4's file kdc/hdb-samba4.c contains the LDB_ functions, which only Samba4 uses directly.

In Samba4's heimdal/lib/hdb/hdb.h, Heimdal's HDB structure contains "hdb-" prefixed function-pointers to the LDB functions. Only Heimdal uses this function-pointer interface to Samba4's LDB_ functions:

  1. (HDB *)->hdb_dbc = NULL;
  2. (HDB *)->hdb_open = LDB_open;
  3. (HDB *)->hdb_close = LDB_close;
  4. (HDB *)->hdb_fetch = LDB_fetch;
  5. (HDB *)->hdb_store = LDB_store;
  6. (HDB *)->hdb_remove = LDB_remove;
  7. (HDB *)->hdb_firstkey = LDB_firstkey;
  8. (HDB *)->hdb_nextkey = LDB_nextkey;
  9. (HDB *)->hdb_lock = LDB_lock;
  10. (HDB *)->hdb_unlock = LDB_unlock;
  11. (HDB *)->hdb_rename = LDB_rename;
  12. (HDB *)->hdb__get = NULL;
  13. (HDB *)->hdb__put = NULL;
  14. (HDB *)->hdb__del = NULL;
  15. (HDB *)->hdb_destroy = LDB_destroy;

Samba4's hdb_ library also includes a local function invoked via a function-pointer:

  1. hdb_ldb_free_entry in kdc/hdb-samba4.c

The function-pointer gets used by both Heimdal & Samba4.


Heimdal's internal hdb library

This library isn't completely "internal," because four of these routines get used by Samba, too:

  1. initialize_hdb_error_table_r
  2. free_hdb_entry
  3. hdb_enctype2key
  4. hdb_free_entry

Further, the global struct hdb_kt_ops{} gets used only by Samba4.


Entry-point heimdal/lib/hdb file Used by
copy_hdb_entry asn1_hdb_entry.c no
copy_hdb_entry_alias asn1_hdb_entry_alias.c no
decode_hdb_entry asn1_hdb_entry.c no
decode_hdb_entry_alias asn1_hdb_entry_alias.c no
encode_hdb_entry asn1_hdb_entry.c no
encode_hdb_entry_alias asn1_hdb_entry_alias.c no
free_hdb_entry asn1_hdb_entry.c both +
free_hdb_entry_alias asn1_hdb_entry_alias.c heimdal
initialize_hdb_error_table hdb_err.c no
initialize_hdb_error_table_r hdb_err.c both
length_hdb_entry asn1_hdb_entry.c no
length_hdb_entry_alias asn1_hdb_entry_alias.c no
_hdb_find_master_key mkey.c heimdal +
_hdb_mkey_decrypt mkey.c heimdal +
_hdb_mkey_version mkey.c heimdal
hdb_add_master_key mkey.c no
hdb_check_db_format hdb.c heimdal +
hdb_clear_extension ext.c heimdal
hdb_clear_master_key mkey.c heimdal +
hdb_create hdb.c heimdal
hdb_db_dir dbinfo.c heimdal +
hdb_dbinfo_get_acl_file dbinfo.c no
hdb_dbinfo_get_binding dbinfo.c no
hdb_dbinfo_get_dbname dbinfo.c no
hdb_dbinfo_get_label dbinfo.c no
hdb_dbinfo_get_log_file dbinfo.c no
hdb_dbinfo_get_mkey_file dbinfo.c no
hdb_dbinfo_get_next dbinfo.c no
hdb_dbinfo_get_realm dbinfo.c no
hdb_free_dbinfo dbinfo.c no
hdb_get_dbinfo dbinfo.c no
hdb_default_db dbinfo.c no
hdb_init_db hdb.c heimdal
hdb_enctype2key hdb.c both ++
hdb_entry_check_mandatory ext.c no
hdb_entry_clear_password ext.c no
hdb_entry_get_aliases ext.c no
hdb_entry_get_ConstrainedDelegACL ext.c heimdal
hdb_entry_get_password ext.c heimdal
hdb_entry_get_pkinit_acl ext.c heimdal
hdb_entry_get_pkinit_hash ext.c no
hdb_entry_get_pw_change_time ext.c no
hdb_entry_set_password ext.c no
hdb_entry_set_pw_change_time ext.c no
hdb_find_extension ext.c heimdal +
hdb_foreach hdb.c no
hdb_free_entry hdb.c both ++
hdb_free_key hdb.c no
hdb_free_keys keys.c no
hdb_free_master_key mkey.c heimdal
hdb_generate_key_set keys.c heimdal
hdb_generate_key_set_password keys.c no
hdb_kt_ops{} keytab.c samba4
hdb_list_builtin hdb.c no
hdb_lock (func ptr) kdc/hdb-samba4.c heimdal ++
hdb_lock hdb.c heimdal
hdb_next_enctype2key hdb.c heimdal +
hdb_process_master_key mkey.c heimdal +
hdb_read_master_key mkey.c heimdal
hdb_replace_extension ext.c heimdal
hdb_seal_key mkey.c no
hdb_seal_keys mkey.c no
hdb_seal_key_mkey mkey.c heimdal
hdb_seal_keys_mkey mkey.c heimdal
hdb_set_master_key mkey.c no
hdb_set_master_keyfile mkey.c heimdal
hdb_unlock (func ptr) kdc/hdb-samba4.c heimdal ++
hdb_unlock hdb.c heimdal
hdb_unseal_key mkey.c no
hdb_unseal_keys mkey.c heimdal +
hdb_unseal_key_mkey mkey.c heimdal
hdb_unseal_keys_mkey mkey.c heimdal

Samba's internal ldb library

These routines are defined & used only in Samba4, and not in Samba4's heimdal snapshot tree.

ldb basic calls

  1. ldb_add
  2. ldb_connect
  3. ldb_debug
  4. ldb_delete
  5. ldb_errstring
  6. ldb_init
  7. ldb_modify
  8. ldb_qsort
  9. ldb_rename
  10. ldb_request
  11. ldb_search
  12. ldb_wait

ldb_attr_ calls

  1. ldb_attr_casefold
  2. ldb_attr_dn
  3. ldb_attr_in_list
  4. ldb_attr_list_copy
  5. ldb_attr_list_copy_add

ldb_build_..._req calls

  1. ldb_build_add_req
  2. ldb_build_del_req
  3. ldb_build_extended_req
  4. ldb_build_mod_req
  5. ldb_build_rename_req
  6. ldb_build_search_req
  7. ldb_build_search_req_ex

ldb_dn_ calls

  1. ldb_dn_add_base
  2. ldb_dn_add_base_fmt
  3. ldb_dn_add_child
  4. ldb_dn_add_child_fmt
  5. ldb_dn_alloc_casefold
  6. ldb_dn_alloc_linearized
  7. ldb_dn_canonical_ex_strin
  8. ldb_dn_canonical_string
  9. ldb_dn_check_local
  10. ldb_dn_check_special
  11. ldb_dn_compare
  12. ldb_dn_compare_base
  13. ldb_dn_copy
  14. ldb_dn_escape_value
  15. ldb_dn_extended_add_synta
  16. ldb_dn_extended_syntax_by
  17. ldb_dn_from_ldb_val
  18. ldb_dn_get_casefold
  19. ldb_dn_get_comp_num
  20. ldb_dn_get_component_name
  21. ldb_dn_get_component_val
  22. ldb_dn_get_extended_compo
  23. ldb_dn_get_extended_linea
  24. ldb_dn_get_linearized
  25. ldb_dn_get_parent
  26. ldb_dn_get_rdn_name
  27. ldb_dn_get_rdn_val
  28. ldb_dn_has_extended
  29. ldb_dn_is_null
  30. ldb_dn_is_special
  31. ldb_dn_is_valid
  32. ldb_dn_map_local
  33. ldb_dn_map_rebase_remote
  34. ldb_dn_new
  35. ldb_dn_new_fmt
  36. ldb_dn_remove_base_compon
  37. ldb_dn_remove_child_compo
  38. ldb_dn_set_component
  39. ldb_dn_set_extended_compo
  40. ldb_dn_validate

ldb_extended_ calls

  1. ldb_extended
  2. ldb_extended_default_call
  3. ldb_extended_dn_in_module
  4. ldb_extended_dn_out_deref
  5. ldb_extended_dn_out_ldb_m
  6. ldb_extended_dn_store_mod

ldb_get_ calls

  1. ldb_get_config_basedn
  2. ldb_get_create_perms
  3. ldb_get_default_basedn
  4. ldb_get_event_context
  5. ldb_get_opaque
  6. ldb_get_root_basedn
  7. ldb_get_schema_basedn

ldb_ldif_ calls

  1. ldb_ldif_read_file
  2. ldb_ldif_read_free
  3. ldb_ldif_read_string
  4. ldb_ldif_write_file

ldb_module_ calls

  1. ldb_module_done
  2. ldb_module_get_ctx
  3. ldb_module_get_private
  4. ldb_module_new
  5. ldb_module_send_entry
  6. ldb_module_send_referral
  7. ldb_module_set_private
  8. ldb_modules_list_from_str
  9. ldb_init_module_chain
  10. ldb_load_modules
  11. ldb_load_modules_list

ldb_..._module_ops calls

  1. ldb_anr_module_ops
  2. ldb_asq_module_ops
  3. ldb_dsdb_cache_module_ops
  4. ldb_entryuuid_module_ops
  5. ldb_instancetype_module_ops
  6. ldb_kludge_acl_module_ops
  7. ldb_ldap_backend_ops
  8. ldb_ldapi_backend_ops
  9. ldb_ldaps_backend_ops
  10. ldb_linked_attributes_module_ops
  11. ldb_local_password_module_ops
  12. ldb_naming_fsmo_module_ops
  13. ldb_nsuniqueid_module_ops
  14. ldb_objectclass_module_ops
  15. ldb_objectguid_module_ops
  16. ldb_operational_module_ops
  17. ldb_paged_results_module_ops
  18. ldb_paged_searches_module_ops
  19. ldb_partition_module_ops
  20. ldb_password_hash_module_ops
  21. ldb_pdc_fsmo_module_ops
  22. ldb_ranged_results_module_ops
  23. ldb_rdn_name_module_ops
  24. ldb_register_module
  25. ldb_repl_meta_data_module_ops
  26. ldb_rootdse_module_ops
  27. ldb_samba3sam_module_ops
  28. ldb_samldb_module_ops
  29. ldb_server_sort_module_ops
  30. ldb_show_deleted_module_ops
  31. ldb_skel_module_ops
  32. ldb_subtree_delete_module_ops
  33. ldb_subtree_rename_module_ops
  34. ldb_tdb_backend_ops
  35. ldb_update_keytab_module_ops
  36. ldb_wins_ldb_module_ops

ldb_msg_ calls

  1. ldb_msg_add
  2. ldb_msg_add_empty
  3. ldb_msg_add_fmt
  4. ldb_msg_add_steal_string
  5. ldb_msg_add_steal_value
  6. ldb_msg_add_string
  7. ldb_msg_add_value
  8. ldb_msg_canonicalize
  9. ldb_msg_check_string_attr
  10. ldb_msg_copy
  11. ldb_msg_copy_attr
  12. ldb_msg_copy_shallow
  13. ldb_msg_diff
  14. ldb_msg_element_compare
  15. ldb_msg_find_attr_as_bool
  16. ldb_msg_find_attr_as_dn
  17. ldb_msg_find_attr_as_int
  18. ldb_msg_find_attr_as_int6
  19. ldb_msg_find_attr_as_stri
  20. ldb_msg_find_attr_as_uint
  21. ldb_msg_find_element
  22. ldb_msg_find_ldb_val
  23. ldb_msg_find_val
  24. ldb_msg_new
  25. ldb_msg_remove_attr
  26. ldb_msg_remove_element
  27. ldb_msg_sanity_check
  28. ldb_msg_sort_elements

ldb_next_

  1. ldb_next_del_trans
  2. ldb_next_end_trans
  3. ldb_next_init
  4. ldb_next_remote_request
  5. ldb_next_request
  6. ldb_next_start_trans

ldb_request

  1. ldb_request_add_control
  2. ldb_request_done
  3. ldb_request_get_control
  4. ldb_request_get_status
  5. ldb_request_set_state

ldb_schema_ calls

  1. ldb_schema_attribute_add
  2. ldb_schema_attribute_add_
  3. ldb_schema_attribute_by_n
  4. ldb_schema_attribute_remo
  5. ldb_schema_attribute_set_
  6. ldb_schema_fsmo_module_op

ldb_set_ calls

  1. ldb_set_create_perms
  2. ldb_set_debug
  3. ldb_set_debug_stderr
  4. ldb_set_default_dns
  5. ldb_set_errstring
  6. ldb_set_modules_dir
  7. ldb_set_opaque
  8. ldb_set_timeout
  9. ldb_set_utf8_default
  10. ldb_set_utf8_fns

ldb time calls

  1. ldb_string_to_time
  2. ldb_string_utc_to_time
  3. ldb_timestring
  4. ldb_timestring_utc

ldb_transaction_ calls

  1. ldb_transaction_cancel
  2. ldb_transaction_commit
  3. ldb_transaction_start

ldb_val_ calls

  1. ldb_val_dup
  2. ldb_val_equal_exact
  3. ldb_valid_attr_name
  4. ldb_val_map_local
  5. ldb_val_map_remote

ldb misc grouped calls

  1. ldb_should_b64_encode
  2. ldb_base64_decode
  3. ldb_base64_encode
  4. ldb_binary_encode
  5. ldb_binary_encode_string
  6. ldb_parse_tree
  7. ldb_parse_tree_attr_replace
  8. ldb_samba_syntax_by_lDAPD
  9. ldb_samba_syntax_by_name
  10. ldb_standard_syntax_by_name

ldb miscellaneous calls

  1. ldb_asprintf_errstring
  2. ldb_casefold
  3. ldb_cmdline_process
  4. ldb_comparison_binary
  5. ldb_connect_backend
  6. ldb_debug_set
  7. ldb_filter_from_tree
  8. ldb_handle_new
  9. ldb_handler_copy
  10. ldb_map_init
  11. ldb_match_msg
  12. ldb_mod_register_control
  13. ldb_op_default_callback
  14. ldb_parse_control_strings
  15. ldb_register_samba_handle
  16. ldb_reply_get_control
  17. ldb_reset_err_string
  18. ldb_search_default_callback
  19. ldb_sequence_number
  20. ldb_setup_wellknown_attributes
  21. ldb_strerror
  22. ldb_wrap_connect