The ConfDB is an interface for data providers to access the configuration information provided in the sssd.conf. More...
Data Structures | |
struct | sss_domain_info |
Data structure storing all of the basic features of a domain. More... | |
Functions | |
int | confdb_init (TALLOC_CTX *mem_ctx, struct confdb_ctx **cdb_ctx, char *confdb_location) |
Initialize the connection to the ConfDB. | |
int | confdb_get_domain (struct confdb_ctx *cdb, const char *name, struct sss_domain_info **domain) |
Get a domain object for the named domain. | |
int | confdb_get_domains (struct confdb_ctx *cdb, struct sss_domain_info **domains) |
Get a null-terminated linked-list of active domain objects. | |
int | confdb_add_param (struct confdb_ctx *cdb, bool replace, const char *section, const char *attribute, const char **values) |
Add an arbitrary parameter to the confdb. | |
int | confdb_get_param (struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx, const char *section, const char *attribute, char ***values) |
Retrieve all values for an attribute. | |
int | confdb_get_string (struct confdb_ctx *cdb, TALLOC_CTX *ctx, const char *section, const char *attribute, const char *defstr, char **result) |
Convenience function to retrieve a single-valued attribute as a string. | |
int | confdb_get_int (struct confdb_ctx *cdb, TALLOC_CTX *ctx, const char *section, const char *attribute, int defval, int *result) |
Convenience function to retrieve a single-valued attribute as an integer. | |
int | confdb_get_bool (struct confdb_ctx *cdb, TALLOC_CTX *ctx, const char *section, const char *attribute, bool defval, bool *result) |
Convenience function to retrieve a single-valued attribute as a boolean. | |
int | confdb_get_string_as_list (struct confdb_ctx *cdb, TALLOC_CTX *ctx, const char *section, const char *attribute, char ***result) |
Convenience function to retrieve a single-valued attribute as a null-terminated array of strings. |
The ConfDB is an interface for data providers to access the configuration information provided in the sssd.conf.
int confdb_add_param | ( | struct confdb_ctx * | cdb, | |
bool | replace, | |||
const char * | section, | |||
const char * | attribute, | |||
const char ** | values | |||
) |
Add an arbitrary parameter to the confdb.
This is mostly useful for testing, as they will not persist between SSSD restarts. For persistence, make changes to the sssd.conf file.
[in] | cdb | The connection object to the confdb |
[in] | replace | If replace is set to true, pre-existing values will be overwritten. If it is false, the provided values will be added to the attribute. |
[in] | section | The ConfDB section to update. This is constructed from the format of the sssd.conf file. All sections start with 'config/'. Subsections are separated by slashes. e.g. [domain/LDAP] in sssd.conf would translate to config/domain/LDAP |
[in] | attribute | The name of the attribute to update |
[in] | values | A null-terminated array of values to add to the attribute |
int confdb_get_bool | ( | struct confdb_ctx * | cdb, | |
TALLOC_CTX * | ctx, | |||
const char * | section, | |||
const char * | attribute, | |||
bool | defval, | |||
bool * | result | |||
) |
Convenience function to retrieve a single-valued attribute as a boolean.
This function will read (in a case-insensitive manner) a "true" or "false" value from the ConfDB and convert it to an integral bool value.
[in] | cdb | The connection object to the confdb |
[in] | ctx | The parent memory context for the returned string |
[in] | section | The ConfDB section to update. This is constructed from the format of the sssd.conf file. All sections start with 'config/'. Subsections are separated by slashes. e.g. [domain/LDAP] in sssd.conf would translate to config/domain/LDAP |
[in] | attribute | The name of the attribute to update |
[in] | defval | If not NULL, the boolean state to use if the attribute does not exist in the ConfDB |
[out] | result | A pointer to the retrieved (or default) bool |
int confdb_get_domain | ( | struct confdb_ctx * | cdb, | |
const char * | name, | |||
struct sss_domain_info ** | domain | |||
) |
Get a domain object for the named domain.
[in] | cdb | The connection object to the confdb |
[in] | name | The name of the domain to retrieve |
[out] | domain | A pointer to a domain object for the domain given by name |
int confdb_get_domains | ( | struct confdb_ctx * | cdb, | |
struct sss_domain_info ** | domains | |||
) |
Get a null-terminated linked-list of active domain objects.
[in] | cdb | The connection object to the confdb |
[out] | domains | A pointer to the first entry of a linked-list of domain objects |
int confdb_get_int | ( | struct confdb_ctx * | cdb, | |
TALLOC_CTX * | ctx, | |||
const char * | section, | |||
const char * | attribute, | |||
int | defval, | |||
int * | result | |||
) |
Convenience function to retrieve a single-valued attribute as an integer.
[in] | cdb | The connection object to the confdb |
[in] | ctx | The parent memory context for the returned string |
[in] | section | The ConfDB section to update. This is constructed from the format of the sssd.conf file. All sections start with 'config/'. Subsections are separated by slashes. e.g. [domain/LDAP] in sssd.conf would translate to config/domain/LDAP |
[in] | attribute | The name of the attribute to update |
[in] | defval | If not NULL, the integer to use if the attribute does not exist in the ConfDB |
[out] | result | A pointer to the retrieved (or default) integer |
int confdb_get_param | ( | struct confdb_ctx * | cdb, | |
TALLOC_CTX * | mem_ctx, | |||
const char * | section, | |||
const char * | attribute, | |||
char *** | values | |||
) |
Retrieve all values for an attribute.
[in] | cdb | The connection object to the confdb |
[in] | mem_ctx | The parent memory context for the value list |
[in] | section | The ConfDB section to update. This is constructed from the format of the sssd.conf file. All sections start with 'config/'. Subsections are separated by slashes. e.g. [domain/LDAP] in sssd.conf would translate to config/domain/LDAP |
[in] | attribute | The name of the attribute to update |
[out] | values | A null-terminated array of cstrings containing all values for this attribute |
int confdb_get_string | ( | struct confdb_ctx * | cdb, | |
TALLOC_CTX * | ctx, | |||
const char * | section, | |||
const char * | attribute, | |||
const char * | defstr, | |||
char ** | result | |||
) |
Convenience function to retrieve a single-valued attribute as a string.
[in] | cdb | The connection object to the confdb |
[in] | ctx | The parent memory context for the returned string |
[in] | section | The ConfDB section to update. This is constructed from the format of the sssd.conf file. All sections start with 'config/'. Subsections are separated by slashes. e.g. [domain/LDAP] in sssd.conf would translate to config/domain/LDAP |
[in] | attribute | The name of the attribute to update |
[in] | defstr | If not NULL, the string to use if the attribute does not exist in the ConfDB |
[out] | result | A pointer to the retrieved (or default) string |
int confdb_get_string_as_list | ( | struct confdb_ctx * | cdb, | |
TALLOC_CTX * | ctx, | |||
const char * | section, | |||
const char * | attribute, | |||
char *** | result | |||
) |
Convenience function to retrieve a single-valued attribute as a null-terminated array of strings.
This function will automatically split a comma-separated string in an attribute into a null-terminated array of strings. This is useful for storing and retrieving ordered lists, as ConfDB multivalued attributes do not guarantee retrieval order.
[in] | cdb | The connection object to the confdb |
[in] | ctx | The parent memory context for the returned string |
[in] | section | The ConfDB section to update. This is constructed from the format of the sssd.conf file. All sections start with 'config/'. Subsections are separated by slashes. e.g. [domain/LDAP] in sssd.conf would translate to config/domain/LDAP |
[in] | attribute | The name of the attribute to update |
[out] | result | A pointer to the retrieved array of strings |
int confdb_init | ( | TALLOC_CTX * | mem_ctx, | |
struct confdb_ctx ** | cdb_ctx, | |||
char * | confdb_location | |||
) |
Initialize the connection to the ConfDB.
[in] | mem_ctx | The parent memory context for the confdb_ctx |
[out] | cdb_ctx | The newly-created connection object |
[in] | confdb_location | The absolute path to the ConfDB file on the filesystem |