use of samba API from openchange

Brad Hards bradh at frogmouth.net
Fri May 13 09:28:39 MDT 2011


Based on some discussions with tridge, I've developed a script that checks 
what symbols are used from openchange, splits them up by where they come from, 
and in the future might be able to help samba and openchange agree on an 
"mostly external" API.

However, openchange currently has a few problems in this regard, where we're 
not linking correctly. Some of it was pretty easy to fix (and is committed into 
openchange trunk). Most of it isn't so simple.

I'd appreciate thoughts on the following specific samba symbols. That might be 
"we can probably fix", "you really should be using some other API" or other.

This is a list of all unresolved symbols that I've found in openchange that 
don't have any version information (and where the library that I'm using is 
samba related).

--- ---
_tevent_req_nterror
Used in code produced by pidl (via a #define in the header).
There is a public header (include/util/tevent_ntstatus.h) but the 
implementation is private (lib/samba/libsamba-sockets.so)

--- ---
cli_credentials_get_username
cli_credentials_init
cli_credentials_set_conf
cli_credentials_set_domain
cli_credentials_set_machine_account
cli_credentials_set_password
cli_credentials_set_realm
cli_credentials_set_username
cli_credentials_set_workstation
Used on both client and server sides
There is a public header (include/credentials.h), but the library that 
provides this is private (lib/samba/libcredentials.so)

--- ---
dcerpc_binding_handle_call
dcerpc_binding_handle_call_recv
dcerpc_binding_handle_call_send
dcerpc_binding_handle_set_timeout
dcerpc_binding_string
dcerpc_errstr
dcerpc_parse_binding
Used in generated code
There is a public header (include/rpc_common.h), but the library that provides 
these is private (lib/samba/librpccommon.so)

--- ---
dom_sid_add_rid
openchange has a private declaration, and the library that provides this is 
private (lib/samba/libsecurity.so)

--- ---
encode_pw_buffer
openchange has a private declaration, and the library that provides this is 
private (lib/samba/libcliauth.so)

--- ---
ldap_encode_ndr_dom_sid
There is a public header (include/ldap_ndr.h), but the library that provides 
this is private (lib/samba/libcli-ldap-common.so)

--- ---
ldb_wrap_connect
There is a public header (include/ldb_wrap.h) but the library that provides 
this is private (lib/samba/libldbsamba.so)

--- ---
lzxpress_compress
lzxpress_decompress

This is private and broken (for compression). Tridge suggested moving the code 
to openchange, and moving it back after we fix it.

--- ---
ndr_table_by_name
ndr_table_by_uuid
ndr_table_init
ndr_table_list
ndr_table_register

Used in mapiproxy/dcesrv_mapiproxy.c
They are from the private lib/samba/libndr-samba4.so library. Openchange has a 
private function declaration

--- ---
nt_errstr
There is a public header (include/core/ntstatus.h) and a public library 
(lib/libnetapi.so)

Possibly just needs a netapi.pc file so we can link to it?

--- ---
ntstatus_dos_equal
There is a public header (include/core/error.h), but the library is private 
(lib/samba/liberrors.so)

--- ---
samdb_ntds_objectGUID
private declaration, samdb_ntds_objectGUID is in a private library 
(lib/samba/libsamdb-common.so),

--- ---
samdb_search_dn
private declaration. samdb_search_dn is in a private library 
(lib/samba/libsamdb-common.so)

--- ---
tevent_req_is_nterror
There is a public header (include/util/tevent_ntstatus.h) but the 
implementation is private (lib/samba/libsamba-sockets.so)


Thanks

Brad

BTW: Here is all of the samba symbols we use, for the terminally curious:
NDR_STANDARD :
set(['ndr_table_samr'])

LDB :
set(['ldb_msg_find_attr_as_string', 'ldb_request', 'ldb_msg_find_attr_as_dn', 
'ldb_msg_find_ldb_val', 'ldb_base64_encode', 'ldb_rename', 'ldb_delete', 
'ldb_connect', 'ldb_errstring', 'ldb_base64_decode', 'ldb_dn_new_fmt', 
'ldb_msg_add_fmt', 'ldb_search_default_callback', 'ldb_get_config_basedn', 
'ldb_ldif_read_free', 'ldb_msg_find_attr_as_uint64', 'ldb_search', 
'ldb_dn_add_child_fmt', 'ldb_add', 'ldb_dn_copy', 'ldb_request_done', 
'ldb_msg_normalize', 'ldb_transaction_start', 'ldb_msg_find_element', 
'ldb_strerror', 'ldb_msg_add_string', 'ldb_msg_find_attr_as_uint', 
'ldb_transaction_commit', 'ldb_ldif_read_file', 'ldb_modify', 
'ldb_ldif_message_string', 'ldb_get_default_basedn', 'ldb_build_search_req', 
'ldb_set_opaque', 'ldb_get_root_basedn', 'ldb_ldif_read_string', 
'ldb_msg_find_attr_as_bool', 'ldb_msg_find_attr_as_int', 
'ldb_msg_find_attr_as_int64', 'ldb_timestring', 'ldb_msg_find_val', 'ldb_init', 
'ldb_set_create_perms', 'ldb_dn_new', 'ldb_parse_control_strings', 
'ldb_set_timeout', 'ldb_dn_get_linearized', 'ldb_dn_validate', 'ldb_msg_new', 
'ldb_wait'])

SAMBA_UTIL :
set(['strlower_talloc', 'dbghdrclass', 'is_zero_ip_v4', 'hex_encode_talloc', 
'strupper_talloc', 'timestring', 'file_load', 'interpret_addr', 'strchr_m', 
'talloc_strdup_upper', 'setup_logging', 'realloc_array', 'arcfour_crypt_blob', 
'nt_time_to_unix', 'pull_ucs2_talloc', 'data_blob_talloc_named', 
'same_net_v4', 'smb_xmemdup', 'smb_xstrdup', 'unix_to_nt_time', 'dbgtext', 
'DEBUGLEVEL_CLASS', 'dump_data', 'data_blob_named', 'str_list_make', 
'all_string_sub', 'data_blob_append', 'smb_panic', 'data_blob_free', 
'nt_time_string', 'generate_random_str', 'interpret_addr2', 
'string_sub_talloc', 'gen_fnmatch', 'timeval_to_nttime', 'strhex_to_str', 
'nttime_to_timeval'])

SAMBA_HOSTCONFIG :
set(['lpcfg_private_dir', 'run_init_functions', 'lpcfg_set_cmdline', 
'lpcfg_server_role', 'lpcfg_load_default', 'loadparm_init', 'lpcfg_parm_int', 
'lpcfg_parm_string', 'lpcfg_realm', 'lpcfg_sam_name', 'lpcfg_parm_bool', 
'load_samba_modules', 'lpcfg_netbios_name', 'lpcfg_interfaces'])

SAMDB :
set(['system_session', 'samdb_connect'])

DCERPC :
set(['dcerpc_register_ep_server', 'dcesrv_call_account_name', 
'dcesrv_handle_new', 'dcerpc_samr_LookupDomain_r', 'dcerpc_pipe_connect', 
'dcerpc_samr_OpenDomain_r', 'dcerpc_fetch_session_key', 
'dcesrv_call_authenticated', 'dcerpc_secondary_context', 
'dcerpc_samr_Connect_r', 'dcerpc_init', 'dcerpc_samr_GetUserPwInfo_r', 
'dcerpc_samr_CreateUser2_r', 'dcesrv_interface_register', 'dcerpc_log_packet', 
'dcerpc_samr_SetUserInfo_r', 'dcesrv_handle_fetch', 
'dcerpc_pipe_connect_b_send', 'dcesrv_call_credentials', 
'dcerpc_samr_DeleteUser_r', 'dcerpc_samr_OpenUser_r', 
'dcerpc_pipe_connect_b_recv', 'dcerpc_samr_LookupNames_r'])

TEVENT :
set(['tevent_req_post', '_tevent_req_nomem', 'tevent_context_init', 
'tevent_req_received', 'tevent_loop_allow_nesting', 
'_tevent_req_callback_data', '_tevent_req_data', 'tevent_req_set_callback', 
'_tevent_req_done', '_tevent_req_create'])

NDR :
set(['ndr_print_get_switch_value', 'ndr_push_bytes', 'ndr_push_enum_uint8', 
'ndr_pull_struct_blob', 'GUID_from_string', 'ndr_print_policy_handle', 
'ndr_print_struct', 'ndr_push_uint8', 'ndr_pull_array_uint8', 
'ndr_print_function_debug', 'ndr_print_GUID', 'ndr_print_union', 
'ndr_pull_error', 'ndr_print_null', 'ndr_pull_advance', 
'ndr_pull_set_switch_value', 'GUID_zero', 'ndr_push_subcontext_start', 
'ndr_push_init_ctx', 'ndr_pull_uint8', 'ndr_push_zero', 
'ndr_pull_policy_handle', 'ndr_push_hyper', 'ndr_push_array_uint8', 
'ndr_pull_dlong', 'ndr_push_uint32', 'ndr_push_dlong', 'ndr_push_int32', 
'ndr_pull_subcontext_start', 'ndr_push_subcontext_end', 
'ndr_push_enum_uint16', 'ndr_print_hyper', 'GUID_from_data_blob', 
'ndr_pull_int32', 'GUID_random', 'ndr_push_error', 'ndr_push_string', 
'ndr_push_set_switch_value', 'ndr_check_array_length', 'ndr_print_int32', 
'ndr_pull_enum_uint1632', 'ndr_pull_trailer_align', 'GUID_equal', 
'ndr_push_enum_uint1632', 'ndr_print_array_uint8', 'ndr_check_array_size', 
'ndr_push_union_align', 'ndr_push_unique_ptr', 'ndr_pull_uint32', 
'ndr_push_policy_handle', 'ndr_print_double', 'ndr_print_string', 
'GUID_string', 'ndr_push_GUID', 'ndr_print_debug_helper', 'GUID_to_ndr_blob', 
'ndr_pull_string', 'ndr_push_DATA_BLOB', 'ndr_set_flags', 'ndr_push_uint3264', 
'ndr_print_uint8', 'ndr_pull_generic_ptr', 'ndr_print_dlong', 'ndr_print_ptr', 
'ndr_push_enum_uint32', 'ndr_print_pointer', 'ndr_charset_length', 
'ndr_print_uint16', 'ndr_pull_array_length', 'ndr_pull_enum_uint32', 
'ndr_push_align', 'ndr_pull_enum_uint8', 'ndr_pull_double', 
'ndr_check_string_terminator', 'ndr_pull_hyper', 'ndr_push_blob', 
'ndr_pull_subcontext_end', 'ndr_push_uint16', 'GUID_all_zero', 
'ndr_push_get_switch_value', 'ndr_pull_union_align', 'ndr_pull_uint16', 
'ndr_get_array_length', 'ndr_pull_GUID', 'ndr_push_trailer_align', 
'ndr_push_double', 'ndr_map_error2ntstatus', 'GUID_from_ndr_blob', 
'ndr_pull_align', 'ndr_pull_array_size', 'ndr_push_expand', 
'ndr_push_charset', 'ndr_print_uint32', 'ndr_get_array_size', 
'ndr_push_struct_blob', 'ndr_pull_init_blob', 'ndr_print_bitmap_flag', 
'ndr_pull_enum_uint16', 'ndr_pull_get_switch_value', 'ndr_print_enum', 
'ndr_pull_DATA_BLOB', 'ndr_print_set_switch_value', 'ndr_pull_charset', 
'ndr_print_DATA_BLOB', 'ndr_print_bad_level'])

TDB :
set(['tdb_errorstr', 'tdb_open_ex', 'tdb_open', 'tdb_name', 'tdb_fetch', 
'tdb_traverse', 'tdb_delete', 'tdb_close', 'tdb_exists', 'tdb_store'])

TALLOC :
set(['talloc_enable_leak_report_full', '_talloc_memdup', 
'_talloc_reference_loc', 'talloc_report', 'talloc_enable_leak_report', 
'talloc_asprintf_append_buffer', 'talloc_init', '_talloc_realloc', 
'_talloc_get_type_abort', 'talloc_named', '_talloc_realloc_array', 
'talloc_autofree_context', 'talloc_strdup_append', 'talloc_strndup', 
'_talloc_set_destructor', '_talloc_zero_array', 'talloc_set_name_const', 
'_talloc_zero', 'talloc_report_full', '_talloc_steal_loc', 
'talloc_named_const', '_talloc_array', 'talloc_asprintf_append', 
'talloc_strdup', 'talloc_check_name', 'talloc_asprintf', '_talloc_free'])


More information about the samba-technical mailing list