summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.c
Commit message (Collapse)AuthorAgeFilesLines
* Update DEBUG* invocations to use new levelsNikolai Kondrashov2014-05-021-24/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a script (identical to commit 83bf46f4066e3d5e838a32357c201de9bd6ecdfd) to update DEBUG* macro invocations, which use literal numbers for levels, to use bitmask macros instead: grep -rl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e 'use strict; use File::Slurp; my @map=qw" SSSDBG_FATAL_FAILURE SSSDBG_CRIT_FAILURE SSSDBG_OP_FAILURE SSSDBG_MINOR_FAILURE SSSDBG_CONF_SETTINGS SSSDBG_FUNC_DATA SSSDBG_TRACE_FUNC SSSDBG_TRACE_LIBS SSSDBG_TRACE_INTERNAL SSSDBG_TRACE_ALL "; my $text=read_file(\*STDIN); my $repl; $text=~s/ ^ ( .* \b (DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM) \s* \(\s* )( [0-9] )( \s*, ) ( \s* ) ( .* ) $ / $repl = $1.$map[$3].$4.$5.$6, length($repl) <= 80 ? $repl : $1.$map[$3].$4."\n".(" " x length($1)).$6 /xmge; print $text; ' < "$f.orig" > "$f" rm "$f.orig" done
* Make DEBUG macro invocations variadicNikolai Kondrashov2014-05-021-51/+51
| | | | | | | | | | | | | | | | | | | | | | | | | Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code (identical to commit a3c8390d19593b1e5277d95bfb4ab206d4785150): grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; print $text;' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* DB: Add sss_ldb_el_to_string_listJakub Hrozek2014-01-291-13/+24
|
* Add sysdb_attrs_get_int32_tSumit Bose2013-12-191-0/+26
|
* Add sysdb_attrs_add_lc_name_aliasSumit Bose2013-12-191-0/+22
|
* Remove the alt_db_path parameter of sysdb_initMichal Zidek2013-03-051-10/+2
| | | | | | This parameter was never used. https://fedorahosted.org/sssd/ticket/1765
* sysdb: try dealing with binary-content attributesJan Engelhardt2013-02-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | https://fedorahosted.org/sssd/ticket/1818 I have here a LDAP user entry which has this attribute loginAllowedTimeMap:: AAAAAAAAAP///38AAP///38AAP///38AAP///38AAP///38AAAAAAAAA In the function sysdb_attrs_add_string(), called from sdap_attrs_add_ldap_attr(), strlen() is called on this blob, which is the wrong thing to do. The result of strlen is then used to populate the .v_length member of a struct ldb_val - and this will set it to zero in this case. (There is also the problem that there may not be a '\0' at all in the blob.) Subsequently, .v_length being 0 makes ldb_modify(), called from sysdb_set_entry_attr(), return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX. End result is that users do not get stored in the sysdb, and programs like `id` or `getent ...` show incomplete information. The bug was encountered with sssd-1.8.5. sssd-1.5.11 seemed to behave fine, but that may not mean that is the absolute lower boundary of introduction of the problem.
* Kill sysdb->domainSimo Sorce2013-01-151-1/+0
| | | | Finally remove this upside-down dependency.
* Move mpg flag to the domain where it belongsSimo Sorce2013-01-151-6/+0
| | | | | A sysdb contains now multiple domains, but the mpg property is a property of a specific domain not of the underlying database.
* Pass the domain to upgrade functionsSimo Sorce2013-01-151-2/+2
|
* Add domain arguemnt to sysdb_get_real_name()Simo Sorce2013-01-151-1/+2
|
* Add domain argument to sysdb_has/set_enumerated()Simo Sorce2013-01-151-7/+5
|
* Pass domain to sysdb_get<pw/gr>nam() functionsSimo Sorce2013-01-151-1/+1
| | | | | | Also allows us to remove sysdb_subdom_get<pw/gr>nam() wrappers and restore fqnames proper value in subdomains, by testing for a parent domain being present or not.
* Upgrade DB and move ranges into top level objectSimo Sorce2013-01-151-0/+7
|
* Make sysdb_custom_subtree_dn() require a domain.Simo Sorce2013-01-151-1/+2
|
* Make sysdb_custom_dn() require a domain.Simo Sorce2013-01-151-1/+2
|
* Make sysdb_domain_dn() require a domain.Simo Sorce2013-01-151-2/+4
|
* Make sysdb_netgroup_base_dn() require a domain.Simo Sorce2013-01-151-3/+5
|
* Make sysdb_netgroup_dn() require a domain explictly.Simo Sorce2013-01-151-2/+2
|
* Make sysdb_group_dn() require a domain explictly.Simo Sorce2013-01-151-2/+2
|
* Make sysdb_user_dn() require a domain explictly.Simo Sorce2013-01-151-2/+2
|
* Remove the sysdb_ctx_get_domain() function.Simo Sorce2013-01-151-5/+0
| | | | | We are deprecating sysdb->domain so kill the function that gives access to this member as we should stop relying on it being available (or correct).
* Refactor single domain initializationSimo Sorce2013-01-151-31/+0
| | | | | Bring it out of sysdb, which will slowly remove internal dependencies on domains and instead will always require them to be passed by callers.
* Refactor sysdb initializationSimo Sorce2013-01-151-128/+11
| | | | | | | | | | | | Change the way sysdbs are initialized. Make callers responsible for providing the list of domains. Remove the returned array of sysdb contexts, it was used only by sss_cache and not really necessary there either as that tool can easily iterate the domains. Make sysdb ctx children of their respective domains. Neither sysdb context nor domains are ever freed until a program is done so there shouldn't be any memory hierarchy issue. As plus we simplify the code by removing a destructor and a setter function.
* Translate LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS to EEXISTSumit Bose2013-01-081-0/+1
| | | | | | | | Currently only the LDB error code indicating that an entry already exists is translated to EEXIST. To make debugging easier and return a better indication of the reason for an error in the logs this patch translates the LDB error code for an already existing attribute or value to EEXIST as well.
* Null pointer dereferenced.Michal Zidek2012-11-281-96/+100
| | | | https://fedorahosted.org/sssd/ticket/1674
* Handle conversion to fully qualified usernamesSimo Sorce2012-11-191-0/+7
| | | | | | | In subdomains we have to use fully qualified usernames. Unfortunately we have no other good option than simply removing caches for users of subdomains. This is because the memberof plugin does not support the rename operation.
* Display more information on DB version mismatchOndrej Kos2012-11-191-2/+34
| | | | | | | | | | | | | https://fedorahosted.org/sssd/ticket/1589 Added check for determining, whether database version is higher or lower than expected. To distinguish it from other errors it uses following retun values (further used for appropriate error message): EMEDIUMTYPE for lower version than expected EUCLEAN for higher version than expected When SSSD or one of it's tools fails on DB version mismatch, new error message is showed suggesting how to proceed.
* sysdb: add sysdb_base_dn()Sumit Bose2012-10-261-0/+4
| | | | | Add a help function which returns the ldb_dn object for the base dn of the cache.
* SSH: Expire hosts in known_hostsJan Cholasta2012-10-051-0/+7
|
* SYSDB: Remove unnecessary domain parameter from several sysdb callsJakub Hrozek2012-09-241-17/+16
| | | | | The domain can be read from the sysdb object. Removing the domain string makes the API more self-contained.
* AUTOFS: convert the existing autofs entries during a sysdb upgradeJakub Hrozek2012-09-241-0/+7
|
* LDB_ERR_INVALID_ATTRIBUTE_SYNTAX added to sysdb_error_to_errno.Michal Zidek2012-09-201-0/+2
|
* SYSDB: Make sysdb_attrs_get_el_int() publicStephen Gallagher2012-08-211-8/+8
| | | | Also rename it to sysdb_attrs_get_el_ext()
* SYSDB: Use ldb_msg_add_string for simple string additionsJakub Hrozek2012-08-061-4/+4
|
* SYSDB: Add log message for unexpected LDB errorsStephen Gallagher2012-07-201-0/+3
|
* Add function sysdb_attrs_copy_values()Jan Zeleny2012-07-181-0/+24
| | | | | This function copies all values from one sysdb_attrs structure to another
* Ghost members - sysdb upgrade routineJan Zeleny2012-05-311-0/+7
| | | | | | | | | | | | It is remotely possible to have sysdb in an inconsistent state that might need upgrade. Consider scenario when user asks for group information. Some fake users are added as a part of this operation. Before users can be fully resolved and stored properly, SSSD is shut down and upgrade is performed. In this case we need to go over all fake user records (uidNumber=0) and replace each of them with ghost record in all group objects that are stated in its memberof attribute.
* SYSDB: check return valueJakub Hrozek2012-05-021-2/+2
| | | | | In addition to testing the number of elements, also check the return value of sysdb_attrs_get_el.
* Sysdb routines for subdomainsJan Zeleny2012-04-241-81/+110
|
* Removed unused function sysdb_attrs_users_from_ldb_vals()Jan Zeleny2012-04-181-46/+0
|
* Save alias of the primary name, tooJakub Hrozek2012-03-211-3/+9
|
* SYSDB: Save only lowercased aliases in case-insensitive domainsStephen Gallagher2012-03-161-19/+28
| | | | https://fedorahosted.org/sssd/ticket/1253
* Remove sysdb_get_ctx_from_list()Sumit Bose2012-02-291-29/+0
|
* Keep sysdb context in domain info structSumit Bose2012-02-291-0/+80
|
* SYSDB: index sudoUserJakub Hrozek2012-01-311-0/+7
| | | | | Most of the the searches in the Sudo responder include the sudoUser attribute. Indexing it will make the responder faster.
* SYSDB: Add sysdb_attrs_get_uint16_tStephen Gallagher2012-01-311-0/+26
|
* SYSDB: Add indexes for servicePort and serviceProtocolStephen Gallagher2012-01-271-0/+7
|
* SYSDB: Redundant check is redundant.Stephen Gallagher2012-01-211-5/+0
| | | | Coverity 12480
* sysdb_get_bool() and sysdb_get_bool() functionsPavel Březina2012-01-171-51/+97
|