include/ldb.h(3)
β¨ NAME β¨
include/ldb.h β Samba's ldb database, bestie. That's the whole name. It lives in the Library Functions Manual, section 3, so it's giving C library header energy. π«Ά
πΈ SYNOPSIS πΈ
okay so before you can even look at the structs, you gotta pull in the headers. No cap, these are the includes:
#include <stdbool.h>
#include <talloc.h>
#include <tevent.h>
#include <ldb_version.h>
#include <ldb_errors.h>
and then, boom, data structures. The header says:
π¦ Data Structures π¦
struct ldb_valβ a result value. that's the whole job. πstruct ldb_message_elementβ results are given back as arrays ofldb_message_element, so this is how you get your result pieces. β¨struct ldb_messageβ aldb_messagerepresents all or part of a record. main character behavior, honestly. πstruct ldb_ldifβ LDIF record. exactly what it sounds like. πstruct ldb_parse_treeβ no blurb in the header, it's just out here being mysterious. πstruct ldb_schema_syntaxβ no extra text, just the struct name and vibes. πstruct ldb_schema_attributeβ again, no description, but it's in the lineup. πstruct ldb_dn_extended_syntaxβ header doesn't explain it, it just exists. π¦struct ldb_sd_flags_controlβ no little description here, just the struct. βstruct ldb_search_options_controlβ same deal: no blurb, only struct. π₯struct ldb_paged_controlβ no description in this part, but it's here. πstruct ldb_extended_dn_controlβ no blurb, it's just listed. πstruct ldb_server_sort_controlβ no description, but iconic name. πstruct ldb_sort_resp_controlβ no blurb in the header. β¨struct ldb_asq_controlβ no description, just the struct. πΈstruct ldb_dirsync_controlβ no blurb, still in the data structures list. π§struct ldb_vlv_req_controlβ no description, just hanging out. π«Άstruct ldb_vlv_resp_controlβ no blurb, but it's here. πstruct ldb_verify_name_controlβ no description, just the struct name. πstruct ldb_controlβ no blurb in the header, but it's a control, iykyk. πstruct ldb_extendedβ no description, just the struct. βstruct ldb_seqnum_requestβ no blurb, but it's in the list. πstruct ldb_seqnum_resultβ no description, still part of the squad. β¨struct ldb_resultβ no blurb, just the struct. πstruct ldb_replyβ no description, but it's here. π¦struct ldb_searchβ no blurb, just the struct. π₯struct ldb_addβ no description, still listed. πstruct ldb_modifyβ no blurb, just the struct. πstruct ldb_deleteβ no description, but it's in the lineup. πΈstruct ldb_renameβ no blurb, just the struct. π§struct ldb_register_controlβ no description, still here. π«Άstruct ldb_register_partitionβ no blurb, just the struct. πstruct ldb_requestβ no description in the header, but it's the last one in this list. π
β¨ Macros β¨
okay bestie, welcome to the macro section of include/ldb.h. these are the little #define spells you'll see all over LDB. some have descriptions, some are just vibes. we're going through every single one, no skips. periodt. π
#define LDB_FLAG_MOD_MASK 0x3β There are a whole bunch of flags that get used withldap_modify()in theldb_message_element.flagsfields. This is the mask for the mod part. β¨#define LDB_FLAG_MOD_TYPE(flags)β Use this to extract the mod type (enum) from the operation. slay.#define LDB_FLAG_MOD_ADD 1β The value used inldap_modify()to say "we're adding attributes". π#define LDB_FLAG_MOD_REPLACE 2β The value used inldap_modify()to say "we're replacing attributes". π¦#define LDB_FLAG_MOD_DELETE 3β The value used inldap_modify()to say "we're deleting attributes". π#define LDB_FLAG_FORCE_NO_BASE64_LDIF 4β Flag value used inldb_ldif_write_trace()to enforce binary encoded attribute values per attribute. no cap.#define LDB_FLAG_INTERNAL_MASK 0xFFFFFFF0β Flag bits on an element that are usable only by the internal implementation. π#define LDB_OID_COMPARATOR_AND '1.2.840.113556.1.4.803'β OID for logic AND comparison. iconic.#define LDB_OID_COMPARATOR_OR '1.2.840.113556.1.4.804'β OID for logic OR comparison. π#define LDB_DEBUG_ALWAYS_LOG LDB_DEBUG_FATALβ (no description, just vibes)#define LDB_FLG_RDONLY 1β Flag value for database connection mode. πΈ#define LDB_FLG_NOSYNC 2β Flag value for database connection mode. β¨#define LDB_FLG_RECONNECT 4β Flag value to specify autoreconnect mode. π₯#define LDB_FLG_NOMMAP 8β Flag to tell backends not to use mmap. π#define LDB_FLG_SHOW_BINARY 16β Flag to tell ldif handlers not to force encoding of binary structures in base64. π#define LDB_FLG_ENABLE_TRACING 32β Flags to enable ldb tracing. π#define LDB_FLG_DONT_CREATE_DB 64β Flags to tell LDB not to create a new database file: π#define LDB_FLG_PRIVATE_MASK 0xff000000β Allow DB create time flags that have meaning only to our calling application or modules. π#define LDB_ATTR_FLAG_HIDDEN (1<<0)β The attribute is not returned by default. lowkey sneaky.#define LDB_ATTR_FLAG_ALLOCATED (1<<1)β (no description, just vibes)#define LDB_ATTR_FLAG_FIXED (1<<2)β The attribute is supplied by the application and should not be removed. periodt.#define LDB_ATTR_FLAG_UNIQUE_INDEX (1<<3)β (no description, just vibes)#define LDB_ATTR_FLAG_SINGLE_VALUE (1<<4)β (no description, just vibes)#define LDB_ATTR_FLAG_FORCE_BASE64_LDIF (1<<5)β (no description, just vibes)#define LDB_ATTR_FLAG_FROM_DB (1<<6)β (no description, just vibes)#define LDB_ATTR_FLAG_INDEXED (1<<7)β (no description, just vibes)#define LDB_SYNTAX_DN '1.3.6.1.4.1.1466.115.121.1.12'β LDAP attribute syntax for a DN. π#define LDB_SYNTAX_DIRECTORY_STRING '1.3.6.1.4.1.1466.115.121.1.15'β LDAP attribute syntax for a Directory String. π¦#define LDB_SYNTAX_INTEGER '1.3.6.1.4.1.1466.115.121.1.27'β LDAP attribute syntax for an integer. π’#define LDB_SYNTAX_ORDERED_INTEGER 'LDB_SYNTAX_ORDERED_INTEGER'β Custom attribute syntax for an integer whose index is lexicographically ordered by attribute value in the database. fancy.#define LDB_SYNTAX_BOOLEAN '1.3.6.1.4.1.1466.115.121.1.7'β LDAP attribute syntax for a boolean. β#define LDB_SYNTAX_OCTET_STRING '1.3.6.1.4.1.1466.115.121.1.40'β LDAP attribute syntax for an octet string. π§#define LDB_SYNTAX_UTC_TIME '1.3.6.1.4.1.1466.115.121.1.53'β LDAP attribute syntax for UTC time. β°#define LDB_SYNTAX_GENERALIZED_TIME '1.3.6.1.4.1.1466.115.121.1.24'β (no description, just vibes)#define LDB_SYNTAX_OBJECTCLASS 'LDB_SYNTAX_OBJECTCLASS'β (no description, just vibes)#define LDB_CONTROL_BYPASS_OPERATIONAL_OID '1.3.6.1.4.1.7165.4.3.13'β OID for getting and manipulating attributes from the ldb without interception in the operational module. π#define LDB_CONTROL_BYPASS_OPERATIONAL_NAME 'bypassoperational'β (no description, just vibes)#define LDB_CONTROL_RECALCULATE_RDN_OID '1.3.6.1.4.1.7165.4.3.30'β OID for recalculate RDN (rdn attribute and 'name') control. β¨#define LDB_CONTROL_RECALCULATE_SD_OID '1.3.6.1.4.1.7165.4.3.5'β OID for recalculate SD control. πΈ#define LDB_CONTROL_RECALCULATE_SD_NAME 'recalculate_sd'β (no description, just vibes)#define LDB_CONTROL_REVEAL_INTERNALS '1.3.6.1.4.1.7165.4.3.6'β REVEAL_INTERNALS is used to reveal internal attributes and DN components which are not normally shown to the user. π#define LDB_CONTROL_REVEAL_INTERNALS_NAME 'reveal_internals'β (no description, just vibes)#define LDB_CONTROL_AS_SYSTEM_OID '1.3.6.1.4.1.7165.4.3.7'β LDB_CONTROL_AS_SYSTEM is used to skip access checks on operations that are performed by the system, but with a user's credentials, e.g. π#define LDB_CONTROL_PROVISION_OID '1.3.6.1.4.1.7165.4.3.16'β LDB_CONTROL_PROVISION_OID is used to skip some constraint checks. π¦#define LDB_CONTROL_PROVISION_NAME 'provision'β (no description, just vibes)#define LDB_CONTROL_PAGED_RESULTS_OID '1.2.840.113556.1.4.319'β OID for the paged results control. π#define LDB_CONTROL_PAGED_RESULTS_NAME 'paged_results'β (no description, just vibes)#define LDB_CONTROL_SD_FLAGS_OID '1.2.840.113556.1.4.801'β OID for specifying the returned elements of the ntSecurityDescriptor. π#define LDB_CONTROL_SD_FLAGS_NAME 'sd_flags'β (no description, just vibes)#define LDB_CONTROL_DOMAIN_SCOPE_OID '1.2.840.113556.1.4.1339'β OID for specifying an advanced scope for the search (one partition). π―#define LDB_CONTROL_DOMAIN_SCOPE_NAME 'domain_scope'β (no description, just vibes)#define LDB_CONTROL_SEARCH_OPTIONS_OID '1.2.840.113556.1.4.1340'β OID for specifying an advanced scope for a search. π#define LDB_CONTROL_SEARCH_OPTIONS_NAME 'search_options'β (no description, just vibes)#define LDB_CONTROL_NOTIFICATION_OID '1.2.840.113556.1.4.528'β OID for notification. π#define LDB_CONTROL_NOTIFICATION_NAME 'notification'β (no description, just vibes)#define LDB_CONTROL_TREE_DELETE_OID '1.2.840.113556.1.4.805'β OID for performing subtree deletes. π³#define LDB_CONTROL_TREE_DELETE_NAME 'tree_delete'β (no description, just vibes)#define LDB_CONTROL_SHOW_DELETED_OID '1.2.840.113556.1.4.417'β OID for getting deleted objects. π#define LDB_CONTROL_SHOW_DELETED_NAME 'show_deleted'β (no description, just vibes)#define LDB_CONTROL_SHOW_RECYCLED_OID '1.2.840.113556.1.4.2064'β OID for getting recycled objects. β»οΈ#define LDB_CONTROL_SHOW_RECYCLED_NAME 'show_recycled'β (no description, just vibes)#define LDB_CONTROL_SHOW_DEACTIVATED_LINK_OID '1.2.840.113556.1.4.2065'β OID for getting deactivated linked attributes. π#define LDB_CONTROL_SHOW_DEACTIVATED_LINK_NAME 'show_deactivated_link'β (no description, just vibes)#define LDB_CONTROL_EXTENDED_DN_OID '1.2.840.113556.1.4.529'β OID for extended DN. π§¬#define LDB_CONTROL_EXTENDED_DN_NAME 'extended_dn'β (no description, just vibes)#define LDB_CONTROL_SERVER_SORT_OID '1.2.840.113556.1.4.473'β OID for LDAP server sort result extension. π#define LDB_CONTROL_SERVER_SORT_NAME 'server_sort'β (no description, just vibes)#define LDB_CONTROL_SORT_RESP_OID '1.2.840.113556.1.4.474'β OID for LDAP server sort result response extension. π#define LDB_CONTROL_SORT_RESP_NAME 'server_sort_resp'β (no description, just vibes)#define LDB_CONTROL_ASQ_OID '1.2.840.113556.1.4.1504'β OID for LDAP Attribute Scoped Query extension. π#define LDB_CONTROL_ASQ_NAME 'asq'β (no description, just vibes)#define LDB_CONTROL_DIRSYNC_OID '1.2.840.113556.1.4.841'β OID for LDAP Directory Sync extension. π#define LDB_CONTROL_DIRSYNC_NAME 'dirsync'β (no description, just vibes)#define LDB_CONTROL_DIRSYNC_EX_OID '1.2.840.113556.1.4.2090'β (no description, just vibes)#define LDB_CONTROL_DIRSYNC_EX_NAME 'dirsync_ex'β (no description, just vibes)#define LDB_CONTROL_VLV_REQ_OID '2.16.840.1.113730.3.4.9'β OID for LDAP Virtual List View Request extension. ποΈ#define LDB_CONTROL_VLV_REQ_NAME 'vlv'β (no description, just vibes)#define LDB_CONTROL_VLV_RESP_OID '2.16.840.1.113730.3.4.10'β OID for LDAP Virtual List View Response extension. π#define LDB_CONTROL_VLV_RESP_NAME 'vlv_resp'β (no description, just vibes)#define LDB_CONTROL_PERMISSIVE_MODIFY_OID '1.2.840.113556.1.4.1413'β OID to let modifies don't give an error when adding an existing attribute with the same value or deleting an nonexisting one attribute. chill mode. π#define LDB_CONTROL_PERMISSIVE_MODIFY_NAME 'permissive_modify'β (no description, just vibes)#define LDB_CONTROL_SERVER_LAZY_COMMIT '1.2.840.113556.1.4.619'β OID to allow the server to be more 'fast and loose' with the data being added. π#define LDB_CONTROL_RODC_DCPROMO_OID '1.2.840.113556.1.4.1341'β Control for RODC join -see [MS-ADTS] section 3.1.1.3.4.1.23. π#define LDB_CONTROL_RODC_DCPROMO_NAME 'rodc_join'β (no description, just vibes)#define LDB_CONTROL_RELAX_OID '1.3.6.1.4.1.4203.666.5.12'β OID for the allowing client to request temporary relaxed enforcement of constraints of the x.500 model. π#define LDB_CONTROL_RELAX_NAME 'relax'β (no description, just vibes)#define LDB_CONTROL_VERIFY_NAME_OID '1.2.840.113556.1.4.1338'β OID for the allowing some kind of relax check for attributes with DNs. β#define LDB_CONTROL_VERIFY_NAME_NAME 'verify_name'β (no description, just vibes)#define LDB_EXTENDED_SEQUENCE_NUMBER '1.3.6.1.4.1.7165.4.4.3'β OID for LDAP Extended Operation SEQUENCE_NUMBER. π’#define LDB_EXTENDED_PASSWORD_CHANGE_OID '1.3.6.1.4.1.4203.1.11.1'β OID for LDAP Extended Operation PASSWORD_CHANGE. π#define LDB_EXTENDED_FAST_BIND_OID '1.2.840.113556.1.4.1781'β OID for LDAP Extended Operation FAST_BIND. β‘#define LDB_EXTENDED_START_TLS_OID '1.3.6.1.4.1.1466.20037'β OID for LDAP Extended Operation START_TLS. π#define LDB_EXTENDED_DYNAMIC_OID '1.3.6.1.4.1.1466.101.119.1'β OID for LDAP Extended Operation DYNAMIC_REFRESH. π#define LDB_EXTENDED_WHOAMI_OID '1.3.6.1.4.1.4203.1.11.3'β OID for RFC4532 WhoAmI"extendedoperation. πͺ#define LDB_CONTROL_POLICY_HINTS_OID '1.2.840.113556.1.4.2239'β OID used to enforce password history length constraints in password reset. π#define LDB_CONTROL_POLICY_HINTS_NAME 'policy_hints'β (no description, just vibes)#define LDB_CONTROL_POLICY_HINTS_DEPRECATED_OID '1.2.840.113556.1.4.2066'β Another OID used to enforce password history length constraints in password reset. π΅#define LDB_CONTROL_POLICY_HINTS_DEPRECATED_NAME 'policy_hints_deprecated'β (no description, just vibes)#define LDB_SEARCH_OPTION_DOMAIN_SCOPE 0x00000001β (no description, just vibes)#define LDB_SEARCH_OPTION_PHANTOM_ROOT 0x00000002β (no description, just vibes)#define LDB_SEQ_GLOBAL_SEQUENCE 0x01β (no description, just vibes)#define LDB_SEQ_TIMESTAMP_SEQUENCE 0x02β (no description, just vibes)#define ldb_attr_cmp(a, b)β Compare two attributes. π#define discard_const(ptr)β (no description, just vibes)#define LDB_TYPESAFE_QSORT(base, numel, opaque, comparison)β (no description, just vibes)#define TYPESAFE_QSORT(base, numel, comparison)β (no description, just vibes)#define NUMERIC_CMP(a, b)β (no description, just vibes)#define LDB_REQ_SET_LOCATION(req)β (no description, just vibes)
β¨ Typedefs β¨
and now the typedefs, bestie. these are the function pointer types that make LDB go round. no descriptions here, just the exact signatures. copy them with love. π
typedef int(* ldb_attr_handler_t) (struct ldb_context *, TALLOC_CTX *mem_ctx, const struct ldb_val *, struct ldb_val *)typedef int(* ldb_attr_comparison_t) (struct ldb_context *, TALLOC_CTX *mem_ctx, const struct ldb_val *, const struct ldb_val *)typedef int(* ldb_attr_operator_t) (struct ldb_context *, enum ldb_parse_op operation, const struct ldb_schema_attribute *a, const struct ldb_val *, const struct ldb_val *, bool *matched)typedef int(* ldb_qsort_cmp_fn_t) (void *v1, void *v2, void *opaque)typedef int(* ldb_request_callback_t) (struct ldb_request *, struct ldb_reply *)
β¨ Enumerations β¨
okay so now we're at the enum part and honestly? this is where ldb.h really starts cooking π₯. These are all the named integer constants the header hands you, and every single one of them is here β nothing skipped, nothing summarised, periodt. Let's take them one at a time, bestie. π
π¦ enum ldb_changetype
enum ldb_changetype { LDB_CHANGETYPE_NONE =0, LDB_CHANGETYPE_ADD,
LDB_CHANGETYPE_DELETE, LDB_CHANGETYPE_MODIFY, LDB_CHANGETYPE_MODRDN
}
LDB_CHANGETYPE_NONEβ parked at=0, the "nothing to see here" one.LDB_CHANGETYPE_ADDβ the add one, going by the name.LDB_CHANGETYPE_DELETEβ and this is the delete one.LDB_CHANGETYPE_MODIFYβ modify energy.LDB_CHANGETYPE_MODRDNβ the mod-RDN one, which is literally what the identifier spells out.
πΈ enum ldb_scope
enum ldb_scope { LDB_SCOPE_DEFAULT =-1, LDB_SCOPE_BASE =0,
LDB_SCOPE_ONELEVEL =1, LDB_SCOPE_SUBTREE =2 }
LDB_SCOPE_DEFAULTβ-1, the "you pick for me" value.LDB_SCOPE_BASEβ0.LDB_SCOPE_ONELEVELβ1.LDB_SCOPE_SUBTREEβ2.
those are your four scope values, all spelled out in the declaration, no guessing required π
π enum ldb_debug_level
enum ldb_debug_level { LDB_DEBUG_FATAL, LDB_DEBUG_ERROR,
LDB_DEBUG_WARNING, LDB_DEBUG_TRACE }
LDB_DEBUG_FATALLDB_DEBUG_ERRORLDB_DEBUG_WARNINGLDB_DEBUG_TRACE
no explicit numbers written next to these ones, so that's exactly how the header lists them β in that order, top to bottom. π«Ά
π§ enum ldb_parse_op
enum ldb_parse_op { LDB_OP_AND =1, LDB_OP_OR =2, LDB_OP_NOT =3,
LDB_OP_EQUALITY =4, LDB_OP_SUBSTRING =5, LDB_OP_GREATER =6,
LDB_OP_LESS =7, LDB_OP_PRESENT =8, LDB_OP_APPROX =9, LDB_OP_EXTENDED
=10 }
LDB_OP_ANDβ=1LDB_OP_ORβ=2LDB_OP_NOTβ=3LDB_OP_EQUALITYβ=4LDB_OP_SUBSTRINGβ=5LDB_OP_GREATERβ=6LDB_OP_LESSβ=7LDB_OP_PRESENTβ=8LDB_OP_APPROXβ=9LDB_OP_EXTENDEDβ=10
ten ops, numbered 1 through 10, and yes we listed every single one because that's the whole assignment π
π enum ldb_request_type
enum ldb_request_type { LDB_SEARCH, LDB_ADD, LDB_MODIFY, LDB_DELETE,
LDB_RENAME, LDB_EXTENDED, LDB_REQ_REGISTER_CONTROL,
LDB_REQ_REGISTER_PARTITION }
LDB_SEARCHLDB_ADDLDB_MODIFYLDB_DELETELDB_RENAMELDB_EXTENDEDLDB_REQ_REGISTER_CONTROLLDB_REQ_REGISTER_PARTITION
eight request types, in that exact order, no explicit values written in the declaration. π
β enum ldb_reply_type
enum ldb_reply_type { LDB_REPLY_ENTRY, LDB_REPLY_REFERRAL,
LDB_REPLY_DONE }
LDB_REPLY_ENTRYLDB_REPLY_REFERRALLDB_REPLY_DONE
three reply types, done and dusted. π
π enum ldb_wait_type
enum ldb_wait_type { LDB_WAIT_ALL, LDB_WAIT_NONE }
LDB_WAIT_ALLLDB_WAIT_NONE
just the two of them, living their best lives.
π enum ldb_state
enum ldb_state { LDB_ASYNC_INIT, LDB_ASYNC_PENDING, LDB_ASYNC_DONE }
LDB_ASYNC_INITLDB_ASYNC_PENDINGLDB_ASYNC_DONE
the async state trio, in that order, exactly as written.
π¦ enum ldb_sequence_type
enum ldb_sequence_type { LDB_SEQ_HIGHEST_SEQ, LDB_SEQ_HIGHEST_TIMESTAMP,
LDB_SEQ_NEXT }
LDB_SEQ_HIGHEST_SEQLDB_SEQ_HIGHEST_TIMESTAMPLDB_SEQ_NEXT
and that's the last one β three sequence types, no explicit values given, and we are not skipping any of them. iykyk πΈ
lowkey important bestie: all ten of these enums are listed with exactly the members and exactly the values the header declares. If you're writing code against ldb.h, use the identifiers, not the raw numbers β the numbers are just what they happen to be set to. π
β¨ FUNCTIONS β¨
okay bestie, this is the function buffet and it is long. grab a snack, hydrate, and let's get into it π every single signature is here, no skips, no cuts, periodt.
struct ldb_parse_tree * ldb_parse_tree (TALLOC_CTX *mem_ctx, const char *s)β no extra notes in the source, just the signature, bestie.char * ldb_filter_from_tree (TALLOC_CTX *mem_ctx, const struct ldb_parse_tree *tree)β same, just the signature.char * ldb_binary_encode (TALLOC_CTX *mem_ctx, struct ldb_val val)β Encode a binary blob.char * ldb_binary_encode_string (TALLOC_CTX *mem_ctx, const char *string)β Encode a string.const struct ldb_schema_attribute * ldb_schema_attribute_by_name (struct ldb_context *ldb, const char *name)β just the signature.const struct ldb_dn_extended_syntax * ldb_dn_extended_syntax_by_name (struct ldb_context *ldb, const char *name)β just the signature.int ldb_request (struct ldb_context *ldb, struct ldb_request *request)β just the signature.int ldb_request_done (struct ldb_request *req, int status)β just the signature.bool ldb_request_is_done (struct ldb_request *req)β just the signature.int ldb_modules_wait (struct ldb_handle *handle)β just the signature.int ldb_wait (struct ldb_handle *handle, enum ldb_wait_type type)β just the signature.int ldb_set_timeout (struct ldb_context *ldb, struct ldb_request *req, int timeout)β just the signature.int ldb_set_timeout_from_prev_req (struct ldb_context *ldb, struct ldb_request *oldreq, struct ldb_request *newreq)β just the signature.void ldb_set_create_perms (struct ldb_context *ldb, unsigned int perms)β just the signature.void ldb_set_modules_dir (struct ldb_context *ldb, const char *path)β just the signature.void ldb_set_event_context (struct ldb_context *ldb, struct tevent_context *ev)β just the signature.struct tevent_context * ldb_get_event_context (struct ldb_context *ldb)β just the signature.int ldb_global_init (void)β Initialise ldbs' global information.struct ldb_context * ldb_init (TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx)β Initialise an ldb context.int ldb_connect (struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[])β Connect to a database.struct ldb_dn * ldb_get_root_basedn (struct ldb_context *ldb)β just the signature.struct ldb_dn * ldb_get_config_basedn (struct ldb_context *ldb)β just the signature.struct ldb_dn * ldb_get_schema_basedn (struct ldb_context *ldb)β just the signature.struct ldb_dn * ldb_get_default_basedn (struct ldb_context *ldb)β just the signature.int ldb_search_default_callback (struct ldb_request *req, struct ldb_reply *ares)β The default async search callback function.int ldb_op_default_callback (struct ldb_request *req, struct ldb_reply *ares)β The default async extended operation callback function.int ldb_modify_default_callback (struct ldb_request *req, struct ldb_reply *ares)β just the signature.int ldb_build_search_req (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *base, enum ldb_scope scope, const char *expression, const char *const *attrs, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β Helper function to build a search request.int ldb_build_search_req_ex (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *base, enum ldb_scope scope, struct ldb_parse_tree *tree, const char *const *attrs, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β just the signature.int ldb_build_add_req (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_message *message, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β Helper function to build an add request.int ldb_build_mod_req (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_message *message, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β Helper function to build a modify request.int ldb_build_del_req (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β Helper function to build a delete request.int ldb_build_rename_req (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_dn *olddn, struct ldb_dn *newdn, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β Helper function to build a rename request.int ldb_request_add_control (struct ldb_request *req, const char *oid, bool critical, void *data)β Add a ldb_control to a ldb_request.int ldb_request_replace_control (struct ldb_request *req, const char *oid, bool critical, void *data)β replace a ldb_control in a ldb_requeststruct ldb_control * ldb_controls_get_control (struct ldb_control **controls, const char *oid)β check if a control with the specified oid"existandreturnitstruct ldb_control * ldb_request_get_control (struct ldb_request *req, const char *oid)β check if a control with the specified oid"existandreturnitstruct ldb_control * ldb_reply_get_control (struct ldb_reply *rep, const char *oid)β check if a control with the specified oid"existandreturnitint ldb_search (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_result **result, struct ldb_dn *base, enum ldb_scope scope, const char *const *attrs, const char *exp_fmt,...) PRINTF_ATTRIBUTE(7β Search the database.int int ldb_add (struct ldb_context *ldb, const struct ldb_message *message)β Add a record to the database.int ldb_modify (struct ldb_context *ldb, const struct ldb_message *message)β Modify the specified attributes of a record.int ldb_rename (struct ldb_context *ldb, struct ldb_dn *olddn, struct ldb_dn *newdn)β Rename a record in the database.int ldb_delete (struct ldb_context *ldb, struct ldb_dn *dn)β Delete a record from the database.int ldb_extended_default_callback (struct ldb_request *req, struct ldb_reply *ares)β The default async extended operation callback function.int ldb_build_extended_req (struct ldb_request **ret_req, struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *oid, void *data, struct ldb_control **controls, void *context, ldb_request_callback_t callback, struct ldb_request *parent)β Helper function to build a extended request.int ldb_extended (struct ldb_context *ldb, const char *oid, void *data, struct ldb_result **res)β call an extended operationint ldb_sequence_number (struct ldb_context *ldb, enum ldb_sequence_type type, uint64_t *seq_num)β Obtain current/next database sequence number.int ldb_transaction_start (struct ldb_context *ldb)β start a transactionint ldb_transaction_prepare_commit (struct ldb_context *ldb)β first phase of two phase commitint ldb_transaction_commit (struct ldb_context *ldb)β commit a transactionint ldb_transaction_cancel (struct ldb_context *ldb)β cancel a transactionint ldb_transaction_cancel_noerr (struct ldb_context *ldb)β just the signature.const char * ldb_errstring (struct ldb_context *ldb)β return extended error information from the last callconst char * ldb_strerror (int ldb_err)β return a string explaining what a ldb error constant meansvoid ldb_set_utf8_default (struct ldb_context *ldb)β setup the default utf8 functions FIXME: these functions do not yet handle utf8 πchar * ldb_casefold (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *s, size_t n)β Casefold a string.int ldb_valid_attr_name (const char *s)β Check the attribute name is valid according to rfc2251.int ldb_ldif_write (struct ldb_context *ldb, int(*fprintf_fn)(void *, const char *,...) PRINTF_ATTRIBUTE(2, 3), void *private_data, const struct ldb_ldif *ldif)β Write an LDIF message.void ldb_ldif_read_free (struct ldb_context *ldb, struct ldb_ldif *msg)β Clean up an LDIF message.struct ldb_ldif * ldb_ldif_read (struct ldb_context *ldb, int(*fgetc_fn)(void *), void *private_data)β Read an LDIF message.struct ldb_ldif * ldb_ldif_read_file (struct ldb_context *ldb, FILE *f)β Read an LDIF message from a file.struct ldb_ldif * ldb_ldif_read_string (struct ldb_context *ldb, const char **s)β Read an LDIF message from a string.int ldb_ldif_parse_modrdn (struct ldb_context *ldb, const struct ldb_ldif *ldif, TALLOC_CTX *mem_ctx, struct ldb_dn **olddn, struct ldb_dn **newrdn, bool *deleteoldrdn, struct ldb_dn **newsuperior, struct ldb_dn **newdn)β Parse a modrdn LDIF message from a struct ldb_message.int ldb_ldif_write_file (struct ldb_context *ldb, FILE *f, const struct ldb_ldif *msg)β Write an LDIF message to a file.char * ldb_ldif_write_string (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_ldif *msg)β Write an LDIF message to a string.char * ldb_ldif_message_string (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, enum ldb_changetype changetype, const struct ldb_message *msg)β Write an LDB message to a string.char * ldb_ldif_message_redacted_string (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, enum ldb_changetype changetype, const struct ldb_message *msg)β Write an LDB message to a string.char * ldb_base64_encode (TALLOC_CTX *mem_ctx, const char *buf, int len)β Base64 encode a buffer.int ldb_base64_decode (char *s)β Base64 decode a buffer.const char * ldb_dn_get_linearized (struct ldb_dn *dn)β Get the linear form of a DN (without any extended components).char * ldb_dn_alloc_linearized (TALLOC_CTX *mem_ctx, struct ldb_dn *dn)β Allocate a copy of the linear form of a DN (without any extended components) onto the supplied memory context.char * ldb_dn_get_extended_linearized (TALLOC_CTX *mem_ctx, struct ldb_dn *dn, int mode)β Get the linear form of a DN (with any extended components).const struct ldb_val * ldb_dn_get_extended_component (struct ldb_dn *dn, const char *name)β just the signature.int ldb_dn_set_extended_component (struct ldb_dn *dn, const char *name, const struct ldb_val *val)β just the signature.void ldb_dn_extended_filter (struct ldb_dn *dn, const char *const *accept_list)β just the signature.void ldb_dn_remove_extended_components (struct ldb_dn *dn)β just the signature.bool ldb_dn_has_extended (struct ldb_dn *dn)β just the signature.int ldb_dn_extended_add_syntax (struct ldb_context *ldb, unsigned flags, const struct ldb_dn_extended_syntax *syntax)β just the signature.struct ldb_dn * ldb_dn_new (TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *dn)β Allocate a new DN from a string.struct ldb_dn * ldb_dn_new_fmt (TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *new_fmt,...) PRINTF_ATTRIBUTE(3β Allocate a new DN from a printf style format string and arguments.struct ldb_dn struct ldb_dn * ldb_dn_from_ldb_val (TALLOC_CTX *mem_ctx,β just the signature.
okay continuing the DN zone, no pauses π β and heads up, this very first one is literally the back half of a prototype that started on the last page, so here it is verbatim:
struct ldb_context *ldb, const struct ldb_val *strdn)
- that fragment above β Allocate a new DN from a
struct ldb_val(useful to avoid buffer overrun). bestie it's the "please don't overrun my buffer" girlie π«Ά bool ldb_dn_validate (struct ldb_dn *dn)β Determine if this DN is syntactically valid. vibe check for your DN, basically πchar * ldb_dn_escape_value (TALLOC_CTX *mem_ctx, struct ldb_val value)β escaping time β¨const char * ldb_dn_get_casefold (struct ldb_dn *dn)β casefold, get it πchar * ldb_dn_alloc_casefold (TALLOC_CTX *mem_ctx, struct ldb_dn *dn)β casefold but it allocates, iconicint ldb_dn_compare_base (struct ldb_dn *base, struct ldb_dn *dn)β comparing basesint ldb_dn_compare (struct ldb_dn *edn0, struct ldb_dn *edn1)β the classic DN-vs-DN showdown πbool ldb_dn_add_base (struct ldb_dn *dn, struct ldb_dn *base)β bolt a base onto a DNbool ldb_dn_add_base_fmt (struct ldb_dn *dn, const char *base_fmt,...)PRINTF_ATTRIBUTE(2β same energy, but with a format string, so it's fancy πbool bool ldb_dn_add_child (struct ldb_dn *dn, struct ldb_dn *child)β yes thebool boolis really in there, don't come for me, I'm copying it character for character πbool ldb_dn_add_child_fmt (struct ldb_dn *dn, const char *child_fmt,...)PRINTF_ATTRIBUTE(2β child + format stringbool bool ldb_dn_remove_base_components (struct ldb_dn *dn, unsigned int num)β again,bool bool, verbatim, slaybool ldb_dn_remove_child_components (struct ldb_dn *dn, unsigned int num)β poppingnumchild componentsbool ldb_dn_add_child_val (struct ldb_dn *dn, const char *rdn, struct ldb_val value)β new child from anrdnand anldb_valstruct ldb_dn * ldb_dn_copy (TALLOC_CTX *mem_ctx, struct ldb_dn *dn)β copy that DN, twin energy π¦struct ldb_dn * ldb_dn_copy_with_ldb_context (TALLOC_CTX *mem_ctx, struct ldb_dn *dn, struct ldb_context *ldb)β copy but bring your ownldbcontextstruct ldb_dn * ldb_dn_get_parent (TALLOC_CTX *mem_ctx, struct ldb_dn *dn)β get the parent, mother is mothering πchar * ldb_dn_canonical_string (TALLOC_CTX *mem_ctx, struct ldb_dn *dn)β canonical string versionchar * ldb_dn_canonical_ex_string (TALLOC_CTX *mem_ctx, struct ldb_dn *dn)β canonical ex string version, the extra letter is doing a lotint ldb_dn_get_comp_num (struct ldb_dn *dn)β how many components?int ldb_dn_get_extended_comp_num (struct ldb_dn *dn)β how many extended components?const char * ldb_dn_get_component_name (struct ldb_dn *dn, unsigned int num)β the name of component numbernumconst struct ldb_val * ldb_dn_get_component_val (struct ldb_dn *dn, unsigned int num)β the value of component numbernumconst char * ldb_dn_get_rdn_name (struct ldb_dn *dn)β the RDN's nameconst struct ldb_val * ldb_dn_get_rdn_val (struct ldb_dn *dn)β the RDN's valueint ldb_dn_set_component (struct ldb_dn *dn, int num, const char *name, const struct ldb_val val)β set componentnumto this name + valuebool ldb_dn_is_valid (struct ldb_dn *dn)β is it valid? we need answers π₯bool ldb_dn_is_special (struct ldb_dn *dn)β is it special? (it's giving main character energy β¨)bool ldb_dn_check_special (struct ldb_dn *dn, const char *check)β check if it matches that special thingbool ldb_dn_is_null (struct ldb_dn *dn)β is it null thoint ldb_dn_update_components (struct ldb_dn *dn, const struct ldb_dn *ref_dn)β refresh your components againstref_dn
okay that's the DN girlies done, now we're on the attribute-name girls πΈ
char * ldb_attr_casefold (TALLOC_CTX *mem_ctx, const char *s)β casefold an attribute stringint ldb_attr_dn (const char *attr)β is this attribute a DN? asksattrdirectly
and nowβ¦ the ldb_message era, which is genuinely most of this page, brace yourself bestie π
struct ldb_message * ldb_msg_new (TALLOC_CTX *mem_ctx)β Create an empty message. blank slate, fresh start, new me πstruct ldb_message_element * ldb_msg_find_element (const struct ldb_message *msg, const char *attr_name)β Find an element within an message. yes it says "an message", I'm not editing the original's grammar, that's not my job πint ldb_val_equal_exact (const struct ldb_val *v1, const struct ldb_val *v2)β Compare twoldb_valvalues. exactly, no vibes-based matchingstruct ldb_val * ldb_msg_find_val (const struct ldb_message_element *el, struct ldb_val *val)β find a value within anldb_message_elementint ldb_msg_add_empty (struct ldb_message *msg, const char *attr_name, int flags, struct ldb_message_element **return_el)β add a new empty element to aldb_messageint ldb_msg_element_add_value (TALLOC_CTX *mem_ctx, struct ldb_message_element *el, const struct ldb_val *val)β add a value to a message elementint ldb_msg_add (struct ldb_message *msg, const struct ldb_message_element *el, int flags)β add a element to aldb_message. "a element." iconic. we keep it π«Άint ldb_msg_add_value (struct ldb_message *msg, const char *attr_name, const struct ldb_val *val, struct ldb_message_element **return_el)β add a value by attribute nameint ldb_msg_add_steal_value (struct ldb_message *msg, const char *attr_name, struct ldb_val *val)β add a value and steal it (ownership snatched, no cap)int ldb_msg_add_steal_string (struct ldb_message *msg, const char *attr_name, char *str)β same but string flavoredint ldb_msg_add_string_flags (struct ldb_message *msg, const char *attr_name, const char *str, int flags)β add a string, but with flagsint ldb_msg_add_string (struct ldb_message *msg, const char *attr_name, const char *str)β add a string, no flags, simple life πint ldb_msg_add_linearized_dn (struct ldb_message *msg, const char *attr_name, struct ldb_dn *dn)β add a linearized DNint ldb_msg_add_fmt (struct ldb_message *msg, const char *attr_name, const char *fmt,...)PRINTF_ATTRIBUTE(3β add a formatted thingint int ldb_msg_append_value (struct ldb_message *msg, const char *attr_name, const struct ldb_val *val, int flags)β append a element to aldb_message. yep,int int. verbatim. don't look at me πint ldb_msg_append_steal_value (struct ldb_message *msg, const char *attr_name, struct ldb_val *val, int flags)β append + steal a valueint ldb_msg_append_steal_string (struct ldb_message *msg, const char *attr_name, char *str, int flags)β append + steal a stringint ldb_msg_append_string (struct ldb_message *msg, const char *attr_name, const char *str, int flags)β append a stringint ldb_msg_append_linearized_dn (struct ldb_message *msg, const char *attr_name, struct ldb_dn *dn, int flags)β append a linearized DNint ldb_msg_append_fmt (struct ldb_message *msg, int flags, const char *attr_name, const char *fmt,...)PRINTF_ATTRIBUTE(4β append, formatted, and note the argument order:flagscomes beforeattr_namehere πint int ldb_msg_element_compare (struct ldb_message_element *el1, struct ldb_message_element *el2)β compare two message elements - return 0 on match. (int intagain, we're loyal to the source π)int ldb_msg_element_compare_name (struct ldb_message_element *el1, struct ldb_message_element *el2)β compare just the names of two elementsconst struct ldb_val * ldb_msg_find_ldb_val (const struct ldb_message *msg, const char *attr_name)β Find elements in a message. and then hand you back aldb_valint ldb_msg_find_attr_as_int (const struct ldb_message *msg, const char *attr_name, int default_value)β find it, read it as anint, fall back todefault_valueunsigned int ldb_msg_find_attr_as_uint (const struct ldb_message *msg, const char *attr_name, unsigned int default_value)β same butunsigned intint64_t ldb_msg_find_attr_as_int64 (const struct ldb_message *msg, const char *attr_name, int64_t default_value)β same butint64_tuint64_t ldb_msg_find_attr_as_uint64 (const struct ldb_message *msg, const char *attr_name, uint64_t default_value)β same butuint64_tdouble ldb_msg_find_attr_as_double (const struct ldb_message *msg, const char *attr_name, double default_value)β same butdoubleβ¨int ldb_msg_find_attr_as_bool (const struct ldb_message *msg, const char *attr_name, int default_value)β same but as a bool, returned as anint, classic C behavior πconst char * ldb_msg_find_attr_as_string (const struct ldb_message *msg, const char *attr_name, const char *default_value)β same but as a stringstruct ldb_dn * ldb_msg_find_attr_as_dn (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_message *msg, const char *attr_name)β same but as a DN, and yes it needs both anldband amem_ctxπΈvoid ldb_msg_sort_elements (struct ldb_message *msg)β sort those elements, organize your life bestiestruct ldb_message * ldb_msg_copy_shallow (TALLOC_CTX *mem_ctx, const struct ldb_message *msg)β a shallow copy, so it's copying the surface not the soul πstruct ldb_message * ldb_msg_copy (TALLOC_CTX *mem_ctx, const struct ldb_message *msg)β the full copystruct ldb_message * ldb_msg_canonicalize (struct ldb_context *ldb, const struct ldb_message *msg) _DEPRECATED_β > deprecated, so maybe don't start anything new with it π«int ldb_msg_normalize (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_message *msg, struct ldb_message **_msg_out)β the non-deprecated normalizing girlie, output lands in_msg_outstruct ldb_message * ldb_msg_diff (struct ldb_context *ldb, struct ldb_message *msg1, struct ldb_message *msg2) _DEPRECATED_β > also deprecated, bestie, heads upint ldb_msg_difference (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg1, struct ldb_message *msg2, struct ldb_message **_msg_out)β return aldb_messagerepresenting the differences betweenmsg1andmsg2.int ldb_msg_check_string_attribute (const struct ldb_message *msg, const char *name, const char *value)β Tries to find a certain string attribute in a message.int ldb_msg_sanity_check (struct ldb_context *ldb, const struct ldb_message *msg)β Integrity check anldb_message. the vibe check, but for data π«Ά
okay we made it past the message mountain, take a breath, hydrate π
struct ldb_val ldb_val_dup (TALLOC_CTX *mem_ctx, const struct ldb_val *v)β Duplicate anldb_valstructure.int ldb_set_debug (struct ldb_context *ldb, void(*debug)(void *context, enum ldb_debug_level level, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3, 0), void *context)β this allows the user to set a debug function for error reportingvoid ldb_set_utf8_functions (struct ldb_context *ldb, void *context, char *(*casefold)(void *, void *, const char *, size_t n), int(*casecmp)(void *ctx, const struct ldb_val *v1, const struct ldb_val *v2))β This allows the user to set custom utf8 functions.void ldb_set_utf8_fns (struct ldb_context *ldb, void *context, char *(*casefold)(void *, void *, const char *, size_t n)) _DEPRECATED_β This legacy function is for setting a custom utf8 casefold function. > deprecated legacy energy, use the newer one above πint ldb_set_debug_stderr (struct ldb_context *ldb)β this sets up debug to print messages onstderrint ldb_set_opaque (struct ldb_context *ldb, const char *name, void *value)β stash something opaque under a namevoid * ldb_get_opaque (struct ldb_context *ldb, const char *name)β grab that opaque thing back outconst char ** ldb_attr_list_copy (TALLOC_CTX *mem_ctx, const char *const *attrs)β copy an attribute listconst char ** ldb_attr_list_copy_add (TALLOC_CTX *mem_ctx, const char *const *attrs, const char *new_attr)β copy it and addnew_attr, multitasking queen πint ldb_attr_in_list (const char *const *attrs, const char *attr)β isattrinattrs??int ldb_msg_rename_attr (struct ldb_message *msg, const char *attr, const char *replace)β renameattrtoreplaceint ldb_msg_copy_attr (struct ldb_message *msg, const char *attr, const char *replace)β copyattrover toreplacevoid ldb_msg_remove_attr (struct ldb_message *msg, const char *attr)β bye bye attribute π¦void ldb_msg_remove_element (struct ldb_message *msg, struct ldb_message_element *el)β bye bye elementvoid ldb_parse_tree_attr_replace (struct ldb_parse_tree *tree, const char *attr, const char *replace)β swapattrforreplaceinside a parse treestruct ldb_parse_tree * ldb_parse_tree_copy_shallow (TALLOC_CTX *mem_ctx, const struct ldb_parse_tree *ot)β shallow copy of a parse treechar * ldb_timestring (TALLOC_CTX *mem_ctx, time_t t)β Convert a time structure to a string.time_t ldb_string_to_time (const char *s)β Convert a string to a time structure.int ldb_val_to_time (const struct ldb_val *v, time_t *t)β convert a LDAP GeneralizedTime string inldb_valformat to atime_t.char * ldb_timestring_utc (TALLOC_CTX *mem_ctx, time_t t)β Convert a time structure to a string. (the UTC one β)time_t ldb_string_utc_to_time (const char *s)β Convert a string to a time structure. (UTC again, consistent queen π)void ldb_qsort (void *const pbase, size_t total_elems, size_t size, void *opaque, ldb_qsort_cmp_fn_t cmp)β sorting, but make it ldbchar * ldb_control_to_string (TALLOC_CTX *mem_ctx, const struct ldb_control *control)β Convert a control into its string representation.struct ldb_control * ldb_parse_control_from_string (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char *control_strings)β Convert a string representing a control into aldb_controlstructure.struct ldb_control ** ldb_parse_control_strings (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const char **control_strings)β Convert an array of string representation of a control into an array ofldb_controlstructures.unsigned int ldb_get_flags (struct ldb_context *ldb)β return the ldb flags π
void ldb_set_flags (struct ldb_context *ldb, unsigned flags)
struct ldb_dn * ldb_dn_binary_from_ldb_val (TALLOC_CTX *mem_ctx, struct
ldb_context *ldb, const struct ldb_val *strdn)
int ldb_dn_get_binary (struct ldb_dn *dn, struct ldb_val *val)
int ldb_dn_set_binary (struct ldb_dn *dn, struct ldb_val *val)
void ldb_req_set_location (struct ldb_request *req, const char
*location)
const char * ldb_req_location (struct ldb_request *req)
bool ldb_dn_minimise (struct ldb_dn *dn)
int ldb_val_string_cmp (const struct ldb_val *v, const char *str)
π Detailed Description π
Samba's ldb database. π
This header file provides the main API for ldb. Like, the whole vibe of ldb lives in here. It's giving "everything you need, bestie". π«Ά
π Macro Definition Documentation π
okay this next bit is the macro section and it is LONG but it is also lowkey iconic so stay with me π
#define discard_const( ptr)
Value:
((void *)((uintptr_t)(ptr)))
#define ldb_attr_cmp( a, b)
Value:
strcasecmp(a, b)
Compare two attributes. This function compares to attribute names. Note that this is a case-insensitive comparison. β¨
Parameters
- a β the first attribute name to compare
- b β the second attribute name to compare
Returns
0 if the attribute names are the same, or only differ in case; non-zero if there are any differences πΈ
attribute names are restricted by rfc2251 so using strcasecmp and toupper here is ok. return 0 for match. no cap. π§
#define LDB_ATTR_FLAG_FIXED (1<<2)
The attribute is supplied by the application and should not be removed. π
#define LDB_ATTR_FLAG_HIDDEN (1<<0)
The attribute is not returned by default. π sneaky.
#define LDB_CONTROL_AS_SYSTEM_OID '1.3.6.1.4.1.7165.4.3.7'
LDB_CONTROL_AS_SYSTEM is used to skip access checks on operations that are performed by the system, but with a user's credentials, e.g. updating prefix map π
#define LDB_CONTROL_ASQ_OID '1.2.840.113556.1.4.1504'
OID for LDAP Attribute Scoped Query extension. This control is included in SearchRequest or SearchResponse messages as part of the controls field of the LDAPMessage. π
#define LDB_CONTROL_BYPASS_OPERATIONAL_OID '1.3.6.1.4.1.7165.4.3.13'
OID for getting and manipulating attributes from the ldb without interception in the operational module. It can be used to access attribute that used to be stored in the sam and that are now calculated. π₯
#define LDB_CONTROL_DIRSYNC_OID '1.2.840.113556.1.4.841'
OID for LDAP Directory Sync extension. This control is included in SearchRequest or SearchResponse messages as part of the controls field of the LDAPMessage. π«
#define LDB_CONTROL_DOMAIN_SCOPE_OID '1.2.840.113556.1.4.1339'
OID for specifying an advanced scope for the search (one partition). π―
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_EXTENDED_DN_OID '1.2.840.113556.1.4.529'
OID for extended DN. πΈ
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_NOTIFICATION_OID '1.2.840.113556.1.4.528'
OID for notification. π
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_PAGED_RESULTS_OID '1.2.840.113556.1.4.319'
OID for the paged results control. This control is included in the searchRequest and searchResultDone messages as part of the controls field of the LDAPMessage, as defined in Section 4.1.12 of LDAP v3. π
See also
#define LDB_CONTROL_PERMISSIVE_MODIFY_OID '1.2.840.113556.1.4.1413'
OID to let modifies don't give an error when adding an existing attribute with the same value or deleting an nonexisting one attribute. π«Ά so forgiving.
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_POLICY_HINTS_DEPRECATED_OID '1.2.840.113556.1.4.2066'
Another OID used to enforce password history length constraints in password reset. This works just like LDB_CONTROL_POLICY_HINTS_OID (above): if the control value is 0x1 on a password set operation, the password history constraints in MS-SAMR 3.1.1.7.1 "General Password Policy" apply as if this was a password change. π
This is used by Entra ID in a password change.
It is also the OID for the ms-DS-Required-Domain-Behavior-Version attribute), which is unlikely to cause confusion given the contexts. π (yes, the parenthesis in the original is doing its own thing, we don't touch it)
#define LDB_CONTROL_POLICY_HINTS_OID '1.2.840.113556.1.4.2239'
OID used to enforce password history length constraints in password reset. If this is control as the value 0x1 on a password set operation, the password history constraints in MS-SAMR 3.1.1.7.1 "GeneralPassword Policy" apply as if this was a password change. This may be used by Entra ID or Keycloak. π
LDB_CONTROL_POLICY_HINTS_DEPRECATED_OID (below) does exactly the same thing and seems to be more widely used in practice. β¨
#define LDB_CONTROL_PROVISION_OID '1.3.6.1.4.1.7165.4.3.16'
LDB_CONTROL_PROVISION_OID is used to skip some constraint checks. It's is mainly thought to be used for the provisioning. π οΈ
#define LDB_CONTROL_RECALCULATE_RDN_OID '1.3.6.1.4.1.7165.4.3.30'
OID for recalculate RDN (rdn attribute and 'name') control. This control forces the rdn_name module to the recalculate the rdn and name attributes as if the object was just created. π±
#define LDB_CONTROL_RECALCULATE_SD_OID '1.3.6.1.4.1.7165.4.3.5'
OID for recalculate SD control. This control force the dsdb code to recalculate the SD of the object as if the object was just created. π
#define LDB_CONTROL_RELAX_OID '1.3.6.1.4.1.4203.666.5.12'
OID for the allowing client to request temporary relaxed enforcement of constraints of the x.500 model. Mainly used for the OpenLDAP backend. π
See also
- draft managedit.
#define LDB_CONTROL_REVEAL_INTERNALS '1.3.6.1.4.1.7165.4.3.6'
REVEAL_INTERNALS is used to reveal internal attributes and DN components which are not normally shown to the user. π peek behind the curtain bestie.
#define LDB_CONTROL_RODC_DCPROMO_OID '1.2.840.113556.1.4.1341'
Control for RODC join -see [MS-ADTS] section 3.1.1.3.4.1.23. π
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SD_FLAGS_OID '1.2.840.113556.1.4.801'
OID for specifying the returned elements of the ntSecurityDescriptor. π
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SEARCH_OPTIONS_OID '1.2.840.113556.1.4.1340'
OID for specifying an advanced scope for a search. π
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SERVER_LAZY_COMMIT '1.2.840.113556.1.4.619'
OID to allow the server to be more 'fast and loose' with the data being added. π it's giving chaotic.
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SERVER_SORT_OID '1.2.840.113556.1.4.473'
OID for LDAP server sort result extension. This control is included in the searchRequest message as part of the controls field of the LDAPMessage, as defined in Section 4.1.12 of LDAP v3. The controlType is set to "1.2.840.113556.1.4.473". The criticality MAY be either TRUE or FALSE (where absent is also equivalent to FALSE) at the client's option. β¨
See also
#define LDB_CONTROL_SHOW_DEACTIVATED_LINK_OID '1.2.840.113556.1.4.2065'
OID for getting deactivated linked attributes. π¦
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SHOW_DELETED_OID '1.2.840.113556.1.4.417'
OID for getting deleted objects. π they're still there bestie.
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SHOW_RECYCLED_OID '1.2.840.113556.1.4.2064'
OID for getting recycled objects. β»οΈ
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_SORT_RESP_OID '1.2.840.113556.1.4.474'
OID for LDAP server sort result response extension. This control is included in the searchResultDone message as part of the controls field of the LDAPMessage, as defined in Section 4.1.12 of LDAP v3. π
See also
#define LDB_CONTROL_TREE_DELETE_OID '1.2.840.113556.1.4.805'
OID for performing subtree deletes. π³βοΈ
See also
- Microsoft documentation of this OID
#define LDB_CONTROL_VERIFY_NAME_OID '1.2.840.113556.1.4.1338'
OID for the allowing some kind of relax check for attributes with DNs. π
See also
- 3.1.1.3.4.1.16 in [MS-ADTS].pdf
#define LDB_CONTROL_VLV_REQ_OID '2.16.840.1.113730.3.4.9'
OID for LDAP Virtual List View Request extension. This control is included in SearchRequest messages as part of the controls field of the LDAPMessage. π
#define LDB_CONTROL_VLV_RESP_OID '2.16.840.1.113730.3.4.10'
OID for LDAP Virtual List View Response extension. This control is included in SearchResponse messages as part of the controls field of the LDAPMessage. π
#define LDB_EXTENDED_DYNAMIC_OID '1.3.6.1.4.1.1466.101.119.1'
OID for LDAP Extended Operation DYNAMIC_REFRESH. This Extended operation is used to create and maintain objects which exist only a specific time, e.g. when a certain client or a certain person is logged in. Data refreshes have to be periodically sent in a specific interval. Otherwise the entry is going to be removed. β³
#define LDB_EXTENDED_FAST_BIND_OID '1.2.840.113556.1.4.1781'
OID for LDAP Extended Operation FAST_BIND. This Extended operations is used to perform a fast bind. β‘
#define LDB_EXTENDED_PASSWORD_CHANGE_OID '1.3.6.1.4.1.4203.1.11.1'
OID for LDAP Extended Operation PASSWORD_CHANGE. This Extended operation is used to allow user password changes by the user itself. π
#define LDB_EXTENDED_SEQUENCE_NUMBER '1.3.6.1.4.1.7165.4.4.3'
OID for LDAP Extended Operation SEQUENCE_NUMBER. This extended operation is used to retrieve the extended sequence number. π’
#define LDB_EXTENDED_START_TLS_OID '1.3.6.1.4.1.1466.20037'
OID for LDAP Extended Operation START_TLS. This Extended operation is used to start a new TLS channel on top of a clear text channel. πβ¨
#define LDB_EXTENDED_WHOAMI_OID '1.3.6.1.4.1.4203.1.11.3'
OID for RFC4532 "Who Am I" extended operation. πͺ
#define LDB_FLAG_FORCE_NO_BASE64_LDIF 4
Flag value used in ldb_ldif_write_trace() to enforce binary encoded attribute values per attribute. This is a genuine flag, being outside LDB_FLAG_MOD_MASK and also outside LDB_FLAG_INTERNAL_MASK π
#define LDB_FLAG_INTERNAL_MASK 0xFFFFFFF0
flag bits on an element usable only by the internal implementation. π hands off bestie.
#define LDB_FLAG_MOD_ADD 1
Value used in ldap_modify() to indicate that attributes are being added. β
See also
LDB_FLAG_MOD_MASK
#define LDB_FLAG_MOD_DELETE 3
Value used in ldap_modify() to indicate that attributes are being deleted. ποΈ
See also
LDB_FLAG_MOD_MASK
#define LDB_FLAG_MOD_MASK 0x3
There are a number of flags that are used with ldap_modify() in ldb_message_element.flags fields. The LDB_FLAG_MOD_ADD, LDB_FLAG_MOD_DELETE and LDB_FLAG_MOD_REPLACE are better thought of as an enumeration, not flags, and are used in ldap_modify() calls to specify whether attributes are being added, deleted or modified respectively. π
#define LDB_FLAG_MOD_REPLACE 2
Value used in ldap_modify() to indicate that attributes are being replaced. π
See also
LDB_FLAG_MOD_MASK
#define LDB_FLAG_MOD_TYPE( flags)
Value:
((flags) & LDB_FLAG_MOD_MASK)
use this to extract the mod type (enum) from the operation π§β¨
LDB_FLG_DONT_CREATE_DB=64β okay so this one is a boundary-setting queen π it tells LDB not to go make a new database file. Why do we care? Because without this flag,ldb_tdb(for example, bestie, for example) will just casually create a blank file during an invocation ofldb_connect(), even when the caller literally only wanted to do read operations β like, for example, inldbsearch. Rude of it honestly.LDB_FLG_ENABLE_TRACING=32β flags to enable ldb tracing β¨LDB_FLG_NOMMAP=8β the "bestie please chill with the memory mapping" flag. Tells backends not to usemmap. π«ΆLDB_FLG_NOSYNC=2β a flag value for database connection mode. IfLDB_FLG_NOSYNCis used inldb_connect, then the database will be opened without synchronous operations, if possible. if possible. iykyk.LDB_FLG_PRIVATE_MASK=0xff000000β this one lets you allow DB create time flags that have meaning only to your calling application or your modules π (your little private corner of flag-space, we love that for you). These must be in this range:LDB_FLG_RDONLY=1β flag value for database connection mode. IfLDB_FLG_RDONLYis used inldb_connect, then the database will be opened read-only, if possible. π
Examples: ldbreader.c.
LDB_FLG_RECONNECT=4β flag value to specify autoreconnect mode. IfLDB_FLG_RECONNECTis used inldb_connect, then the backend will be opened in a way that makes it try to auto reconnect if the connection is dropped (this actually makes sense only with ldap). π "my wifi dropped mid-query and the backend just β¨recoversβ¨"LDB_FLG_SHOW_BINARY=16β flag to tell ldif handlers not to force encoding of binary structures in base64. show me the raw vibes.LDB_OID_COMPARATOR_AND='1.2.840.113556.1.4.803'β OID for logic AND comparison. This is the well known object ID for a logical AND comparator. πLDB_OID_COMPARATOR_OR='1.2.840.113556.1.4.804'β OID for logic OR comparison. This is the well known object ID for a logical OR comparator. πLDB_REQ_SET_LOCATION( req)β okay so this is a macro whose Value is:
ldb_req_set_location(req, __location__)
little one-liner, iconic, does exactly what it says. π
LDB_SYNTAX_BOOLEAN='1.3.6.1.4.1.1466.115.121.1.7'β LDAP attribute syntax for a boolean. This is the well-known LDAP attribute syntax for a boolean.
See RFC 2252, Section 4.3.2
LDB_SYNTAX_DIRECTORY_STRING='1.3.6.1.4.1.1466.115.121.1.15'β LDAP attribute syntax for a Directory String. This is the well-known LDAP attribute syntax for a Directory String.
See also: RFC 2252, Section 4.3.2
LDB_SYNTAX_DN='1.3.6.1.4.1.1466.115.121.1.12'β LDAP attribute syntax for a DN. This is the well-known LDAP attribute syntax for a DN. π¦
See RFC 2252, Section 4.3.2
LDB_SYNTAX_INTEGER='1.3.6.1.4.1.1466.115.121.1.27'β LDAP attribute syntax for an integer. This is the well-known LDAP attribute syntax for an integer.
See RFC 2252, Section 4.3.2
LDB_SYNTAX_OCTET_STRING='1.3.6.1.4.1.1466.115.121.1.40'β LDAP attribute syntax for an octet string. This is the well-known LDAP attribute syntax for an octet string.
See RFC 2252, Section 4.3.2
LDB_SYNTAX_ORDERED_INTEGER='LDB_SYNTAX_ORDERED_INTEGER'β a custom attribute syntax for an integer whose index is lexicographically ordered by attribute value in the database. not a well-known OID, it's our special little guy πLDB_SYNTAX_UTC_TIME='1.3.6.1.4.1.1466.115.121.1.53'β LDAP attribute syntax for UTC time. This is the well-known LDAP attribute syntax for a UTC time.
See RFC 2252, Section 4.3.2
LDB_TYPESAFE_QSORT( base, numel, opaque, comparison)β the type-safe sort, bestie, and its Value is:
do { \
if (numel > 1) { \
ldb_qsort(base, numel, sizeof((base)[0]), discard_const(opaque), (ldb_qsort_cmp_fn_t)comparison); \
if (0) { \
comparison(&((base)[0]), &((base)[1]), opaque); \
} \
} \
} while (0)
note the if (0) block β it's a compile-time vibe check that your comparison function actually typechecks, but it never runs. iconic. β¨
NUMERIC_CMP( a, b)β Value:
(((a) > (b)) - ((a) < (b)))
it's giving "just tell me the ordering without any branches" π
TYPESAFE_QSORT( base, numel, comparison)β the non-ldb-flavoured sibling, and its Value is:
do { \
if (numel > 1) { \
qsort(base, numel, sizeof((base)[0]), (int (*)(const void *, const void *))comparison); \
if (0) { \
comparison(&((base)[0]), &((base)[1])); \
} \
} \
} while (0)
same energy, same sneaky if (0) typecheck. π
π§ FUNCTION DOCUMENTATION π§
okay bestie, deep breath, we're in the function zone now. every one of these lives in ldb.h and they're all so valid. let's go. π
int int ldb_add (struct ldb_context * ldb, const struct ldb_message * message)β Add a record to the database. (yes theint intis really in there, we don't touch it, we respect the artifact π)
This function adds a record to the database. This function will fail if a record with the specified class and key already exists in the database. no duplicates, we don't do that here.
Parameters
ldbβ the context associated with the database (fromldb_init())messageβ the message containing the record to add.
Returns
result code (LDB_SUCCESS if the record was added, otherwise a failure code)
int ldb_base64_decode (char * s)β Base64 decode a buffer. This function decodes a base64 encoded string in place. π«Ά
Parameters
sβ the string to decode.
Returns
the length of the returned (decoded) string.
Note: the string is null terminated, but the null terminator is not included in the length. (the null is just there for vibes, not for counting πΈ)
char * ldb_base64_encode (TALLOC_CTX * mem_ctx, const char * buf, int len)β Base64 encode a buffer. β¨
Parameters
mem_ctxβ the memory context that the result is allocated from.bufβ pointer to the array that is to be encodedlenβ the number of elements in the array to be encoded
Returns
pointer to an array containing the encoded data
Note: The caller is responsible for freeing the result. that's on you bestie, talloc won't do it for you π
char * ldb_binary_encode (TALLOC_CTX * mem_ctx, struct ldb_val val)β Encode a binary blob. This function encodes a binary blob using the encoding rules in RFC 2254 (Section 4). This function also escapes any non-printable characters. π¦
Parameters
mem_ctxβ the memory context to allocate the return string in.valβ the (potentially) binary data to be encoded
Returns
the encoded data as a null terminated string
See also: RFC 2252.
char * ldb_binary_encode_string (TALLOC_CTX * mem_ctx, const char * string)β Encode a string. This function encodes a string using the encoding rules in RFC 2254 (Section 4). This function also escapes any non-printable characters. π
Parameters
mem_ctxβ the memory context to allocate the return string in.stringβ the string to be encoded
Returns
the encoded data as a null terminated string
See also: RFC 2252.
int ldb_build_add_req (struct ldb_request ** ret_req, struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const struct ldb_message * message, struct ldb_control ** controls, void * context, ldb_request_callback_t callback, struct ldb_request * parent)β Helper function to build an add request. π οΈ
Parameters
ret_reqβ the request structure is returned here (talloced onmem_ctx)ldbβ the context associated with the database (fromldb_init())mem_ctxβ a talloc memory context (used as parent ofret_req)messageβ contains the entry to be addedcontrolsβ an array of controlscontextβ the callback function contextcallbackβ the callback function to handle the async repliesparentβ the parent request if any
Returns
result code (LDB_SUCCESS on success, or a failure code)
int ldb_build_del_req (struct ldb_request ** ret_req, struct ldb_context * ldb, TALLOC_CTX * mem_ctx, struct ldb_dn * dn, struct ldb_control ** controls, void * context, ldb_request_callback_t callback, struct ldb_request * parent)β Helper function to build a delete request. ποΈ
Parameters
ret_reqβ the request structure is returned here (talloced onmem_ctx)ldbβ the context associated with the database (fromldb_init())mem_ctxβ a talloc memory context (used as parent ofret_req)dnβ the DN to be deletedcontrolsβ an array of controlscontextβ the callback function contextcallbackβ the callback function to handle the async repliesparentβ the parent request if any
Returns
result code (LDB_SUCCESS on success, or a failure code)
int ldb_build_extended_req (struct ldb_request ** ret_req, struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const char * oid, void * data, struct ldb_control ** controls, void * context, ldb_request_callback_t callback, struct ldb_request * parent)β Helper function to build a extended request. π
Parameters
ret_reqβ the request structure is returned here (talloced onmem_ctx)ldbβ the context associated with the database (fromldb_init())mem_ctxβ a talloc memory context (used as parent ofret_req)oidβ the OID of the extended operation.dataβ a void pointer to the extended operation specific parameters, it needs to beNULLor a valid talloc pointer!talloc_get_type()will be used on itcontrolsβ an array of controlscontextβ the callback function contextcallbackβ the callback function to handle the async repliesparentβ the parent request if any
Returns
result code (LDB_SUCCESS on success, or a failure code)
int ldb_build_mod_req (struct ldb_request ** ret_req, struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const struct ldb_message * message, struct ldb_control ** controls, void * context, ldb_request_callback_t callback, struct ldb_request * parent)β Helper function to build a modify request. π
Parameters
ret_reqβ the request structure is returned here (talloced onmem_ctx)ldbβ the context associated with the database (fromldb_init())mem_ctxβ a talloc memory context (used as parent ofret_req)messageβ contains the entry to be modifiedcontrolsβ an array of controlscontextβ the callback function contextcallbackβ the callback function to handle the async repliesparentβ the parent request if any
Returns
result code (LDB_SUCCESS on success, or a failure code)
int ldb_build_rename_req (struct ldb_request ** ret_req, struct ldb_context * ldb, TALLOC_CTX * mem_ctx, struct ldb_dn * olddn, struct ldb_dn * newdn, struct ldb_control ** controls, void * context, ldb_request_callback_t callback, struct ldb_request * parent)β Helper function to build a rename request. β¨
Parameters
ret_reqβ the request structure is returned here (talloced onmem_ctx)ldbβ the context associated with the database (fromldb_init())mem_ctxβ a talloc memory context (used as parent ofret_req)olddnβ the old DNnewdnβ the new DNcontrolsβ an array of controlscontextβ the callback function contextcallbackβ the callback function to handle the async repliesparentβ the parent request if any
Returns
result code (LDB_SUCCESS on success, or a failure code)
int ldb_build_search_req (struct ldb_request ** ret_req, struct ldb_context * ldb, TALLOC_CTX * mem_ctx, struct ldb_dn * base, enum ldb_scope scope, const char * expression, const char *const * attrs, struct ldb_control ** controls, void * context, ldb_request_callback_t callback, struct ldb_request * parent)β Helper function to build a search request. π
Parameters
ret_reqβ the request structure gets returned right here, and it's talloced ontomem_ctxπldbβ the context tied to the database (you got it fromldb_init())mem_ctxβ a talloc memory context, used as the parent ofret_reqbaseβ the Base Distinguished Name for the query (useldb_dn_new()if you want an empty one)scopeβ the search scope for the queryexpressionβ the search expression this query is gonna useattrsβ the search attributes for the query (passNULLif you don't need any)controlsβ an array of controlscontextβ the callback function contextcallbackβ the callback function that handles the async repliesparentβ the parent request, if there is one
Returns
result code (LDB_SUCCESS on success, or a failure code) β¨
π ldb_casefold
char * ldb_casefold (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const char * s, size_t n)
Casefold a string, bestie. Heads up tho: the callback needs to be ASCII compatible. So ASCII has to be handled first, before any UTF-8 β that's literally required so you don't get weird issues with dotted languages π
Parameters
ldbβ the ldb contextmem_ctxβ the memory context the result string's memory gets allocated fromsβ the string that's about to be folded
Returns
a copy of the string, converted to upper case π
Note
The default function is not yet UTF8 aware. Provide your own set of functions through ldb_set_utf8_fns() π
π ldb_connect
int ldb_connect (struct ldb_context * ldb, const char * url, unsigned int flags, const char * options[])
Connect to a database. This is typically called soon after ldb_init(), and it's required before any search or database modification operations. no cap.
The URL can be one of these forms, and only these:
tdb://pathldapi://pathldap://hostmdb://path
Parameters
ldbβ the context associated with the database (fromldb_init())urlβ the URL of the database to connect to, as noted aboveflagsβ a combination ofLDB_FLG_*to modify the connection behaviouroptionsβ backend specific options, passed uninterpreted straight to the backend
Returns
result code (LDB_SUCCESS on success, or a failure code) β¨
Note
It's an error to connect to a database that doesn't exist in readonly mode (that is, with LDB_FLG_RDONLY). But in read-write mode? The database just gets created if it's not there π¦
Examples
ldbreader.c.
π ldb_control_to_string
char * ldb_control_to_string (TALLOC_CTX * mem_ctx, const struct ldb_control * control)
Convert a control into its string representation. glow up moment β¨
Parameters
mem_ctxβ TALLOC context to return result on, and to allocateerror_stringoncontrolβ astruct ldb_controlto convert
Returns
string representation of the control π
β ldb_controls_get_control
struct ldb_control * ldb_controls_get_control (struct ldb_control ** controls, const char * oid)
Check if a control with the specified oid exists and hand it over π
Parameters
controlsβ the array of controlsoidβ the object identifier of the control as string
Returns
the control, or NULL if it's not found π
π₯ ldb_delete
int ldb_delete (struct ldb_context * ldb, struct ldb_dn * dn)
Delete a record from the database. Yeah, that's it, that's the whole job β this function deletes a record from the database. gone. periodt.
Parameters
ldbβ the context associated with the database (fromldb_init())dnβ the DN for the record to be deleted
Returns
result code (LDB_SUCCESS if the record was deleted, otherwise a failure code) πΈ
π¦ ldb_dn_alloc_linearized
char * ldb_dn_alloc_linearized (TALLOC_CTX * mem_ctx, struct ldb_dn * dn)
Allocate a copy of the linear form of a DN (without any extended components) onto the supplied memory context. iconic.
Parameters
dnβ The DN to linearizemem_ctxβ TALLOC context to return result on
π ldb_dn_from_ldb_val
struct ldb_dn struct ldb_dn * ldb_dn_from_ldb_val (TALLOC_CTX * mem_ctx, struct ldb_context * ldb, const struct ldb_val * strdn)
Allocate a new DN from a struct ldb_val (super useful to avoid buffer overrun, fr fr).
Parameters
mem_ctxβ TALLOC context to return resultingldb_dnstructure ondnβ The new DN
Note
The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntactically correct π
π ldb_dn_get_extended_linearized
char * ldb_dn_get_extended_linearized (TALLOC_CTX * mem_ctx, struct ldb_dn * dn, int mode)
Get the linear form of a DN β this time with any extended components π
Parameters
mem_ctxβ TALLOC context to return result ondnβ The DN to linearizemodeβ Style of extended DN to return (0is HEX representation of binary form,1is a string form)
π ldb_dn_get_linearized
const char * ldb_dn_get_linearized (struct ldb_dn * dn)
Get the linear form of a DN (without any extended components). that's the whole vibe.
Parameters
dnβ The DN to linearize
β¨ ldb_dn_new
struct ldb_dn * ldb_dn_new (TALLOC_CTX * mem_ctx, struct ldb_context * ldb, const char * dn)
Allocate a new DN from a string. slay π
Parameters
mem_ctxβ TALLOC context to return resultingldb_dnstructure ondnβ The new DN
Note
The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntactically correct π¦
π ldb_dn_new_fmt
struct ldb_dn * ldb_dn_new_fmt (TALLOC_CTX * mem_ctx, struct ldb_context * ldb, const char * new_fmt, ...)
Allocate a new DN from a printf style format string and arguments. fancy.
Parameters
mem_ctxβ TALLOC context to return resultingldb_dnstructure onnew_fmtβ The new DN as a format string (plus arguments)
Note
The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntactically correct π
β ldb_dn_validate
bool ldb_dn_validate (struct ldb_dn * dn)
Determine if this DN is syntactically valid. vibe check, but for DNs πΈ
Parameters
dnβ The DN to validate
π₯ ldb_errstring
const char * ldb_errstring (struct ldb_context * ldb)
Return extended error information from the last call. the receipts, basically π
π ldb_extended
int ldb_extended (struct ldb_context * ldb, const char * oid, void * data, struct ldb_result ** res)
Call an extended operation π
Parameters
ldbβ the context associated with the database (fromldb_init())oidβ the OID of the extended operationdataβ a void pointer to the extended operation specific parameters. It needs to beNULLor a valid talloc pointer!talloc_get_type()will be used on it πresβ the result of the extended operation
Returns
result code (LDB_SUCCESS if the extended operation returned fine, otherwise a failure code) β¨
π¦ ldb_extended_default_callback
int ldb_extended_default_callback (struct ldb_request * req, struct ldb_reply * ares)
The default async extended operation callback function. it's giving default, but make it cute.
Parameters
reqβ the request we are callback ofaresβ a single reply from the async core
Returns
result code (LDB_SUCCESS on success, or a failure code) π
Note
this function expectsreq->contextto always be anstruct ldb_resultpointer AND a talloc context. This function will steal on the context each message from thearesreply passed on by the async core, so that in the end all the messages will be in the context (ldb_result) memory tree. Freeing the passed context (ldb_resulttree) will free all the resources β but the request needs to be freed separately, and the result does not depend on the request, which can be freed as soon as the search request is finished π
π ldb_get_flags
unsigned int ldb_get_flags (struct ldb_context * ldb)
Return the ldb flags. that's it bestie π«Ά
β¨ ldb_global_init
int ldb_global_init (void )
Initialise ldbs' global information. This is required before any other LDB call. periodt.
Returns
0 if initialisation succeeded, -1 otherwise π
π ldb_init
struct ldb_context * ldb_init (TALLOC_CTX * mem_ctx, struct tevent_context * ev_ctx)
Initialise an ldb context. Also required before any other LDB call π
Parameters
mem_ctxβ pointer to a talloc memory context. PassNULLif there's no suitable context available.
Note
The LDB modules will be loaded from the directory specified by the environment variable LDB_MODULES_PATH. If that variable isn't specified, the compiled-in default is used π
Returns
pointer to ldb_context that should be free'd (using talloc_free()) at the end of the program π
Examples
ldbreader.c, and ldifreader.c.
π ldb_ldif_message_redacted_string
char * ldb_ldif_message_redacted_string (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, enum ldb_changetype changetype, const struct ldb_message * msg)
Write an LDB message to a string βοΈ
Parameters
ldbβ the ldb context (fromldb_init())mem_ctxβ the talloc context on which to attach the string)changetypeβLDB_CHANGETYPE_ADDorLDB_CHANGETYPE_MODIFYmsgβ the message to write out
Returns
the string containing the LDIF, or NULL on error β but with secret attributes redacted π
Note
The secret attributes are specified in a'const char * const *'within theLDB_SECRET_ATTRIBUTE_LISTopaque set on the ldb π
See also
ldb_ldif_message_string for an exact representation of the message as LDIF π
π ldb_ldif_message_string
char * ldb_ldif_message_string (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, enum ldb_changetype changetype, const struct ldb_message * msg)
Write an LDB message to a string βοΈ
Parameters
ldbβ the ldb context (fromldb_init())mem_ctxβ the talloc context on which to attach the string)changetypeβLDB_CHANGETYPE_ADDorLDB_CHANGETYPE_MODIFYmsgβ the message to write out
Returns
the string containing the LDIF, or NULL on error πΈ
See also
ldb_ldif_message_redacted_string for a safer version of this function π
β ldb_ldif_parse_modrdn
int ldb_ldif_parse_modrdn (struct ldb_context * ldb, const struct ldb_ldif * ldif, TALLOC_CTX * mem_ctx, struct ldb_dn ** olddn, struct ldb_dn ** newrdn, bool * deleteoldrdn, struct ldb_dn ** newsuperior, struct ldb_dn ** newdn)
Parse a modrdn LDIF message from a struct ldb_message π§
Parameters
ldbβ the ldb context (fromldb_init())ldifβ the preparsed LDIF chunk (fromldb_ldif_read())mem_ctxβ the memory context that's used for return valuesolddnβ the old dn asstruct ldb_dn, if not needed passNULLnewrdnβ the new rdn asstruct ldb_dn, if not needed passNULLdeleteoldrdnβ thedeleteoldrdnvalue asbool, if not needed passNULLnewsuperiorβ thenewsuperiordn asstruct ldb_dn, if not needed passNULL.newsuperiorcan beNULLas it is optional in the LDIF πnewdnβ the full constructed new dn asstruct ldb_dn, if not needed passNULL
π¦ ldb_ldif_read
struct ldb_ldif * ldb_ldif_read (struct ldb_context * ldb, int(* fgetc_fn )(void *), void * private_data)
Read an LDIF message. This function creates an LDIF message using a caller supplied read function π
Parameters
ldbβ the ldb context (fromldb_init()) πfgetc_fnβ a function pointer for the read function. This one's gotta take a private data pointer, and it must return a pointer to an integer that's the next byte read (orEOFif there's literally nothing left to read).private_dataβ pointer that gets handed right back to the read function. Super handy for keeping state or context around. π
Returns
the LDIF message that has been read in β¨
Note
You must free the LDIF message when you don't need it anymore, using ldb_ldif_read_free(). Not optional, bestie. π
See also
ldb_ldif_read_filefor a way more convenient way to read from a file stream.ldb_ldif_read_stringfor a way more convenient way to read from a string (char array).ldb_ldif_writefor the writer equivalent to this function.
π struct ldb_ldif * ldb_ldif_read_file (struct ldb_context * ldb, FILE * f)
Read an LDIF message from a file. This one pulls the next LDIF message out of the contents of a file stream. Wanna get all the LDIF messages? Then you're gonna repeatedly call this function until it hands you back NULL. That's the whole loop, no cap. π¦
Parameters
ldbβ the ldb context (fromldb_init())fβ the file stream to read from (typically fromfdopen())
See also
ldb_ldif_read_stringfor an equivalent function that will read from a string (char array).ldb_ldif_write_filefor the writer equivalent to this function.
Examples
ldifreader.c.
πΈ void ldb_ldif_read_free (struct ldb_context * ldb, struct ldb_ldif * msg)
Clean up an LDIF message. This function cleans up a LDIF message read using ldb_ldif_read() or related functions (such as ldb_ldif_read_string() and ldb_ldif_read_file(). π§
Parameters
ldbβ the ldb context (fromldb_init())msgβ the message to clean up and free
Examples
ldifreader.c.
π struct ldb_ldif * ldb_ldif_read_string (struct ldb_context * ldb, const char ** s)
Read an LDIF message from a string. This one reads the next LDIF message from the contents of a char array. Want all of the LDIF messages? Same deal β keep calling this function until it returns NULL. π₯
Parameters
ldbβ the ldb context (fromldb_init())sβ pointer to the char array to read from
See also
ldb_ldif_read_filefor an equivalent function that will read from a file stream.ldb_ldif_writefor a more general (arbitrary read function) version of this function.
π int ldb_ldif_write (struct ldb_context * ldb, int(* )(void *, const char *,...) PRINTF_ATTRIBUTE fprintf_fn(2, 3), void * private_data, const struct ldb_ldif * ldif)
Write an LDIF message. This function writes an LDIF message using a write function that you, the caller, supply. Main character energy, honestly. π
Parameters
ldbβ the ldb context (fromldb_init())fprintf_fnβ a function pointer for the write function. It's gotta take a private data pointer, then a format string, then a variable argument list.private_dataβ pointer that will be provided back to the write function. Great for holding onto state or context. π«Άldifβ the message to write out
Returns
the total number of bytes written, or an error code as returned from the write function.
See also
ldb_ldif_write_filefor a more convenient way to write to a file stream.ldb_ldif_readfor the reader equivalent to this function.
Examples
ldbreader.c, and ldifreader.c.
π int ldb_ldif_write_file (struct ldb_context * ldb, FILE * f, const struct ldb_ldif * msg)
Write an LDIF message to a file. π
Parameters
ldbβ the ldb context (fromldb_init())fβ the file stream to write to (typically fromfdopen())msgβ the message to write out
Returns
the total number of bytes written, or a negative error code
See also
ldb_ldif_read_filefor the reader equivalent to this function.
β char * ldb_ldif_write_string (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const struct ldb_ldif * msg)
Write an LDIF message to a string. β¨
Parameters
ldbβ the ldb context (fromldb_init())mem_ctxβ the talloc context on which to attach the stringmsgβ the message to write out
Returns
the string containing the LDIF, or NULL on error π
See also
ldb_ldif_read_stringfor the reader equivalent to this function.
π int ldb_modify (struct ldb_context * ldb, const struct ldb_message * message)
Modify the specified attributes of a record. This function modifies a record that's already chilling in the database. π¦
Parameters
ldbβ the context associated with the database (fromldb_init())messageβ the message containing the changes required.
Returns
result code (LDB_SUCCESS if the record was modified as requested, otherwise a failure code)
π int ldb_msg_add (struct ldb_message * msg, const struct ldb_message_element * el, int flags)
add a element to a ldb_message πΈ
π§ int ldb_msg_add_empty (struct ldb_message * msg, const char * attr_name, int flags, struct ldb_message_element ** return_el)
add a new empty element to a ldb_message
π int int ldb_msg_append_value (struct ldb_message * msg, const char * attr_name, const struct ldb_val * val, int flags)
append a element to a ldb_message
π
int ldb_msg_check_string_attribute (const struct ldb_message * msg, const char * name, const char * value)
Tries to find a certain string attribute in a message. π
Parameters
msgβ the message to checknameβ attribute namevalueβ attribute value
Returns
1 on match and 0 otherwise.
π₯ int ldb_msg_difference (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, struct ldb_message * msg1, struct ldb_message * msg2, struct ldb_message ** _msg_out)
return a ldb_message representing the differences between msg1 and msg2. And if you then use this in a ldb_modify() call, it can be used to save edits to a message. Iconic behaviour honestly. π
Result message is constructed as follows:
LDB_FLAG_MOD_ADDβ elements found only inmsg2LDB_FLAG_MOD_REPLACEβ elements inmsg2that have different value inmsg1Value formsg2element is usedLDB_FLAG_MOD_DELETEβ elements found only inmsg2
Returns
LDB_SUCCESS or LDB_ERR_OPERATIONS_ERROR
π int ldb_msg_element_add_value (TALLOC_CTX * mem_ctx, struct ldb_message_element * el, const struct ldb_val * val)
add a value to a message element π
β int int ldb_msg_element_compare (struct ldb_message_element * el1, struct ldb_message_element * el2)
compare two message elements β return 0 on match
π¦ struct ldb_message_element * ldb_msg_find_element (const struct ldb_message * msg, const char * attr_name)
Find an element within an message. π
πΈ const struct ldb_val * ldb_msg_find_ldb_val (const struct ldb_message * msg, const char * attr_name)
Find elements in a message. This function finds elements and converts to a specific type, with a given default value if not found. Assumes that elements are single valued. π
π§ struct ldb_val * ldb_msg_find_val (const struct ldb_message_element * el, struct ldb_val * val)
find a value within an ldb_message_element
Parameters
elβ the element to searchvalβ the value to search for
Note
This search is case sensitive. Don't come crying whenFooandfoodon't match, bestie. π
π struct ldb_message * ldb_msg_new (TALLOC_CTX * mem_ctx)
Create an empty message. β¨
Parameters
mem_ctxβ the memory context to create in. You can passNULLto get the top level context, however the ldb context (fromldb_init()) may be a better choice
π int ldb_msg_sanity_check (struct ldb_context * ldb, const struct ldb_message * msg)
Integrity check an ldb_message. This function performs basic sanity / integrity checks on an ldb_message. Vibe check for your message, fr fr. π«Ά
Parameters
ldbβ context in which to perform the checksmsgβ the message to check
Returns
LDB_SUCCESS if the message is OK, or a non-zero error code (one of LDB_ERR_INVALID_DN_SYNTAX, LDB_ERR_ENTRY_ALREADY_EXISTS or LDB_ERR_INVALID_ATTRIBUTE_SYNTAX) if there is a problem with a message.
π int ldb_op_default_callback (struct ldb_request * req, struct ldb_reply * ares)
The default async extended operation callback function. π
Parameters
reqβ the request we are callback ofaresβ a single reply from the async core
Returns
result code (LDB_SUCCESS on success, or a failure code)
π struct ldb_control * ldb_parse_control_from_string (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const char * control_strings)
Convert a string representing a control into a ldb_control structure. β¨
Parameters
ldbβ LDB contextmem_ctxβ TALLOC context to return result on, and to allocateerror_stringoncontrol_stringsβ A string-formatted control
Returns
a ldb_control element
π¦ struct ldb_control ** ldb_parse_control_strings (struct ldb_context * ldb, TALLOC_CTX * mem_ctx, const char ** control_strings)
Convert an array of string representation of a control into an array of ldb_control structures. π
Parameters
ldbβ LDB contextmem_ctxβ TALLOC context to return result on, and to allocateerror_stringoncontrol_stringsβ Array of string-formatted controls
Returns
array of ldb_control elements
π₯ int ldb_rename (struct ldb_context * ldb, struct ldb_dn * olddn, struct ldb_dn * newdn)
Rename a record in the database. This function renames a record in the database. π
Parameters
ldbβ the context associated with the database (fromldb_init())olddnβ the DN for the record to be renamed.newdnβ the new DN
Returns
result code (LDB_SUCCESS if the record was renamed as requested, otherwise a failure code)
π struct ldb_control * ldb_reply_get_control (struct ldb_reply * rep, const char * oid)
check if a control with the specified "oid" exist and return it π
Parameters
repβ the reply struct to search for the controloidβ the object identifier of the control as string
Returns
the control, NULL if not found π
π int ldb_request_add_control (struct ldb_request * req, const char * oid, bool critical, void * data)
Add a ldb_control to a ldb_request. β¨
Parameters
reqβ the request struct where to add the controloidβ the object identifier of the control as stringcriticalβ whether the control should be critical or notdataβ a talloc pointer to the control specific data
Returns
result code (LDB_SUCCESS on success, or a failure code)
π struct ldb_control * ldb_request_get_control (struct ldb_request * req, const char * oid)
check if a control with the specified "oid" exist and return it π«Ά
Parameters
reqβ the request struct to search for the controloidβ the object identifier of the control as string- Returns β the control, or
NULLif it wasn't found π«Ά
π
ldb_request_replace_control
int ldb_request_replace_control (struct ldb_request * req, const char * oid,
bool critical, void * data)
Swaps out a ldb_control inside a ldb_request, bestie. Out with the old, in with the new β¨
Parameters
reqβ the request struct where we're adding the controloidβ the object identifier of the control, as a stringcriticalβ whether the control should be critical or notdataβ atallocpointer to the control-specific data
Returns
result code β LDB_SUCCESS if it slayed, or a failure code π
π ldb_search
int ldb_search (struct ldb_context * ldb, TALLOC_CTX * mem_ctx,
struct ldb_result ** result, struct ldb_dn * base,
enum ldb_scope scope, const char *const * attrs,
const char * exp_fmt, ...)
Search the database, babe π This one goes digging through the database and hands you back the records that match an LDAP-ish search expression. It's the main character of lookups, fr fr.
Parameters
ldbβ the context tied to the database (the one you got fromldb_init())mem_ctxβ the memory context to use for the request and the resultsresultβ the return resultbaseβ the Base Distinguished Name for the query (useldb_dn_new()if you want an empty one)scopeβ the search scope for the queryattrsβ the search attributes for the query (passNULLif you don't need any)exp_fmtβ the search expression for this query (printf-like, so it takes the...args)
Returns
result code β LDB_SUCCESS on success, or a failure code π«
Note: usetalloc_free()to free theldb_resultyou get back, bestie. Don't just leave it lying there π
Examples
ldbreader.c.
π ldb_search_default_callback
int ldb_search_default_callback (struct ldb_request * req,
struct ldb_reply * ares)
The default async search callback function. It's giving "reliable friend who handles your replies for you" πΈ
Parameters
reqβ the request we're the callback ofaresβ a single reply from the async core
Returns
result code β LDB_SUCCESS on success, or a failure code
Note: this function expectsreq->contextto always be astruct ldb_resultpointer AND a talloc context. It will steal onto that context every single message from thearesreply that the async core passes along, so that in the end all the messages live inside that context (ldb_result) memory tree. Freeing the context you passed in (theldb_resulttree) frees all the resources. The request has to be freed separately, and the result does not depend on the request β so you can free the request the moment the search request is finished π
π’ ldb_sequence_number
int ldb_sequence_number (struct ldb_context * ldb,
enum ldb_sequence_type type, uint64_t * seq_num)
Obtain the current/next database sequence number. Numbers, but make it mysterious β¨
π ldb_set_debug
int ldb_set_debug (struct ldb_context * ldb, void(* )(void *context, enum
ldb_debug_level level, const char *fmt, va_list ap) PRINTF_ATTRIBUTE
debug(3, 0), void * context)
This lets you, the user, set your very own debug function for error reporting. Custom bug-spotting, periodt π₯
π₯οΈ ldb_set_debug_stderr
int ldb_set_debug_stderr (struct ldb_context * ldb)
Sets up debug so all the messages print on stderr. Old reliable π
π ldb_set_utf8_default
void ldb_set_utf8_default (struct ldb_context * ldb)
Sets up the default utf8 functions. FIXME: these functions do not yet handle utf8 π (yes, we know, we know β it's literally in the source)
π§ ldb_set_utf8_fns
void ldb_set_utf8_fns (struct ldb_context * ldb, void * context,
char *(* casefold )(void *, void *, const char *, size_t n))
This legacy function is for setting a custom utf8 casefold function. It cannot set a comparison function, which makes it very difficult for a comparison to be both efficient and correct. Not it π
Use ldb_set_utf8_functions() instead! Like, for real, bestie, that's the upgrade.
π ldb_set_utf8_functions
void ldb_set_utf8_functions (struct ldb_context * ldb, void * context,
char *(* casefold )(void *, void *, const char *, size_t n),
int(* casecmp )(void *ctx, const struct ldb_val *v1,
const struct ldb_val *v2))
This allows you to set custom utf8 functions. Be aware that casefolding in some locales will break ldb's expectations π¬ In particular, if 'i' is uppercased to 'Δ°' (a capital I with a dot, used in some languages), the string '<guid=' will not equal '<GUID='. Rude, honestly.
The default functions casefold ASCII only, and the ones Samba uses are built on a version of the NTFS UCS-2 upcase table which is dotted-i safe. Samba stays winning π
The context argument gets passed to the casefold() and casecmp() functions as their first argument. It's unused in the default and Samba implementations, but you could, for example, use it to hold a libICU context.
The second argument for the casefold function is a TALLOC context.
π’ ldb_strerror
const char * ldb_strerror (int ldb_err)
Returns a string explaining what a ldb error constant actually means. Translating cryptic into clear, iykyk π«Ά
β° ldb_string_to_time
time_t ldb_string_to_time (const char * s)
Converts a string to a time structure. Specifically, this turns an LDAP formatted GeneralizedTime string into a time_t structure.
Parameters
sβ the string to convert
Returns
the time structure, or 0 if the string can't be converted π
π°οΈ ldb_string_utc_to_time
time_t ldb_string_utc_to_time (const char * s)
Converts a string to a time structure. This one turns an LDAP formatted UTCTime string into a time_t structure. Different format, same energy β¨
Parameters
sβ the string to convert
Returns
the time structure, or 0 if the string can't be converted
π
ldb_timestring
char * ldb_timestring (TALLOC_CTX * mem_ctx, time_t t)
Converts a time structure to a string. This one takes a time_t structure and gives you back an LDAP formatted GeneralizedTime string.
Parameters
mem_ctxβ the memory context to allocate the return string intβ the time structure to convert
Returns
the formatted string, or NULL if the time structure couldn't be converted π«
ποΈ ldb_timestring_utc
char * ldb_timestring_utc (TALLOC_CTX * mem_ctx, time_t t)
Converts a time structure to a string. This one takes a time_t structure and gives you back an LDAP formatted UTCTime string.
Parameters
mem_ctxβ the memory context to allocate the return string intβ the time structure to convert
Returns
the formatted string, or NULL if the time structure couldn't be converted
π ldb_transaction_cancel
int ldb_transaction_cancel (struct ldb_context * ldb)
Cancel a transaction. Nope, never mind, we're not doing this π
β
ldb_transaction_commit
int ldb_transaction_commit (struct ldb_context * ldb)
Commit a transaction. Locking it in, no take-backs π
πͺ ldb_transaction_prepare_commit
int ldb_transaction_prepare_commit (struct ldb_context * ldb)
First phase of two phase commit. The "getting ready" era before the actual "doing it" era β¨
π ldb_transaction_start
int ldb_transaction_start (struct ldb_context * ldb)
Start a transaction. And so it begins, bestie π¬
π¦ ldb_val_dup
struct ldb_val ldb_val_dup (TALLOC_CTX * mem_ctx,
const struct ldb_val * v)
Duplicates an ldb_val structure. This copies an ldb value structure, so you get your own little clone π«Ά
Parameters
mem_ctxβ the memory context the duplicated value will be allocated fromvβ theldb_valto be duplicated.
Returns
the duplicated ldb_val structure. Twins! π―
βοΈ ldb_val_equal_exact
int ldb_val_equal_exact (const struct ldb_val * v1,
const struct ldb_val * v2)
Compares two ldb_val values. Are they the same? Vibe check π
Parameters
v1β firstldb_valstructure to be testedv2β secondldb_valstructure to be tested
Returns
1 for a match, 0 if there's any difference. Exact or nothing, no notes π
β³ ldb_val_to_time
int ldb_val_to_time (const struct ldb_val * v, time_t * t)
Converts an LDAP GeneralizedTime string in ldb_val format to a time_t. Time-zone-hopping from val-land into time-land πΈ
π€ ldb_valid_attr_name
int ldb_valid_attr_name (const char * s)
Checks that the attribute name is valid according to rfc2251. Gatekeeping, but make it standards-compliant π
Parameters
sβ the string to check
Returns
1 if the name is ok β
π Author
Generated automatically by Doxygen for LDB from the source code. (Not a human, just a very diligent robot who never misses π«‘)
And that's a wrap on the whole page, bestie!! π You made it all the way to the bottom, which is honestly iconic behavior π The little footer at the very end stamps the source/version as LDB and the page as include/ldb.h(3) β that's your "the end, go touch grass" marker π
β¨ π
π¦ where this page comes from
- fedora 44: libldb-devel 2:4.24.0-6.fc44 Β· LGPL-3.0-or-later
- fedora 44: libldb-devel 2:4.24.0-6.fc44 Β· LGPL-3.0-or-later
- fedora 44: libldb-devel 2:4.24.7-1.fc44 Β· LGPL-3.0-or-later
- fedora 44: libldb-devel 2:4.24.7-1.fc44 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms