logo_kerberos.gif

Difference between revisions of "Samba4 Port: hdb & ldb Interfaces"

From K5Wiki
Jump to: navigation, search
(Heimdal's internal hdb library)
(Heimdal's hdb Interface to Samba4's LDB)
Line 25: Line 25:
 
# (HDB *)->hdb_close = LDB_close;
 
# (HDB *)->hdb_close = LDB_close;
 
# (HDB *)->hdb_fetch = LDB_fetch;
 
# (HDB *)->hdb_fetch = LDB_fetch;
  +
# (HDB *)->hdb_free = LDB_free;
 
# (HDB *)->hdb_store = LDB_store;
 
# (HDB *)->hdb_store = LDB_store;
 
# (HDB *)->hdb_remove = LDB_remove;
 
# (HDB *)->hdb_remove = LDB_remove;

Revision as of 20:08, 14 September 2009

This page aims to reduce the confusion about four DB libraries:

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

This page also answers two questions that we've wondered about, and which are important for the Samba4 port to MIT-krb:

  1. Does Heimdal call Samba4 directly?
  2. Does Samba4 call Heimdal functions directly, without going through the libkdc interface?

Unfortunately, the answer to both questions is "Yes."


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_free = LDB_free;
  6. (HDB *)->hdb_store = LDB_store;
  7. (HDB *)->hdb_remove = LDB_remove;
  8. (HDB *)->hdb_firstkey = LDB_firstkey;
  9. (HDB *)->hdb_nextkey = LDB_nextkey;
  10. (HDB *)->hdb_lock = LDB_lock;
  11. (HDB *)->hdb_unlock = LDB_unlock;
  12. (HDB *)->hdb_rename = LDB_rename;
  13. (HDB *)->hdb__get = NULL;
  14. (HDB *)->hdb__put = NULL;
  15. (HDB *)->hdb__del = NULL;
  16. (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.

Two functions here, hdb_lock & hdb_unlock, have the same names as two of the LDB function-pointers (see above):

  1. (HDB *)->hdb_lock ,
  2. (HDB *)->hdb_unlock .

Heimdal uses these two function pointers heavily.


Entry-point heimdal/lib/hdb file Heim use Smb4 use
copy_hdb_entry asn1_hdb_entry.c
copy_hdb_entry_alias asn1_hdb_entry_alias.c
decode_hdb_entry asn1_hdb_entry.c
decode_hdb_entry_alias asn1_hdb_entry_alias.c
encode_hdb_entry asn1_hdb_entry.c
encode_hdb_entry_alias asn1_hdb_entry_alias.c
free_hdb_entry asn1_hdb_entry.c hdb ++ LDB +
free_hdb_entry_alias asn1_hdb_entry_alias.c
initialize_hdb_error_table hdb_err.c
initialize_hdb_error_table_r hdb_err.c hdb kdc
length_hdb_entry asn1_hdb_entry.c
length_hdb_entry_alias asn1_hdb_entry_alias.c
_hdb_fetch common.c hdb
_hdb_store common.c hdb
_hdb_remove common.c hdb
_hdb_find_master_key mkey.c hdb
_hdb_mkey_decrypt mkey.c hdb
_hdb_mkey_version mkey.c hdb
hdb_add_master_key mkey.c
hdb_check_db_format hdb.c NDBM, DB, hdb
hdb_clear_extension ext.c hdb
hdb_clear_master_key mkey.c NDBM, DB
hdb_create hdb.c hdb
hdb_db_dr dbinfo.c kdc
hdb_dbinfo_get_acl_file dbinfo.c
hdb_dbinfo_get_binding dbinfo.c
hdb_dbinfo_get_dbname dbinfo.c
hdb_dbinfo_get_label dbinfo.c
hdb_dbinfo_get_log_file dbinfo.c
hdb_dbinfo_get_mkey_file dbinfo.c
hdb_dbinfo_get_next dbinfo.c
hdb_dbinfo_get_realm dbinfo.c
hdb_free_dbinfo dbinfo.c
hdb_get_dbinfo dbinfo.c
hdb_default_db dbinfo.c
hdb_init_db hdb.c NDBM, DB, hdb
hdb_enctype2key hdb.c kdc ++, tgs ++ kdc
hdb_entry_check_mandatory ext.c
hdb_entry_clear_password ext.c
hdb_entry_get_aliases ext.c
hdb_entry_get_ConstrainedDelegACL ext.c tgs
hdb_entry_get_password ext.c kdc
hdb_entry_get_pkinit_acl ext.c kdc
hdb_entry_get_pkinit_hash ext.c
hdb_entry_get_pw_change_time ext.c
hdb_entry_set_password ext.c
hdb_entry_set_pw_change_time ext.c
hdb_find_extension ext.c hdb ++
hdb_foreach hdb.c
hdb_free_entry hdb.c NDBM, DB, kdc, hdb + kdc ++
hdb_free_key hdb.c
hdb_free_keys keys.c
hdb_free_master_key mkey.c hdb
hdb_generate_key_set keys.c hdb
hdb_generate_key_set_password keys.c
hdb_kt_ops{} keytab.c kdc
hdb_list_builtin hdb.c
hdb_lock hdb.c NDBM, DB
hdb_next_enctype2key hdb.c kdc +, hdb
hdb_process_master_key mkey.c hdb ++
hdb_read_master_key mkey.c hdb
hdb_replace_extension ext.c hdb
hdb_seal_key mkey.c
hdb_seal_keys mkey.c
hdb_seal_key_mkey mkey.c hdb
hdb_seal_keys_mkey mkey.c hdb
hdb_set_master_key mkey.c
hdb_set_master_keyfile mkey.c hdb +
hdb_unlock hdb.c NDBM, DB
hdb_unseal_key mkey.c
hdb_unseal_keys mkey.c NDBM, DB
hdb_unseal_key_mkey mkey.c hdb
hdb_unseal_keys_mkey mkey.c hdb

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