summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_upgrade.c
Commit message (Collapse)AuthorAgeFilesLines
* SYSDB: Fixing DB updatePetr Cech2016-07-111-3/+19
| | | | | | | | | | | | | | Functions sysdb_user_base_dn() and sysdb_group_base_dn() expect that struct sss_domain_info contains pointer to struct sysdb_ctx. This is not true in case of sysdb_upgrade functions. This patch fixes the situation and revert code to the state before 12a000c8c7c07259e438fb1e992134bdd07d9a30 commit. Resolves: https://fedorahosted.org/sssd/ticket/3023 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com>
* SYSDB: qualify_attr: create new attribute only onceSumit Bose2016-07-071-3/+8
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SYSDB: Upgrade sysdb to use qualified names for users and groups, sudo rules ↵Jakub Hrozek2016-07-071-0/+581
| | | | | | | | | | and override objects Runs a sysdb upgrade that changes objects that represent users, groups, sudo rules and overrides to the new schema, which uses the fully qualified names. Reviewed-by: Sumit Bose <sbose@redhat.com>
* SYSDB: Open a timestamps cache for caching domainsJakub Hrozek2016-06-231-4/+4
| | | | | | | | | | | For all domain types, except the local domain, open a connection to a new ldb file located at /var/lib/sss/db names timestamps_$domain.ldb. Constructs the ldb file path manually in sysdb_check_upgrade_02() but that should be acceptable because nobody should be running such an old cache these days anyway. Reviewed-by: Sumit Bose <sbose@redhat.com>
* SYSDB: Refactor database connectionJakub Hrozek2016-06-231-2/+2
| | | | | | | | | | | | | | | | | | | | | Changes the functions in sysdb_init.c so that the functions are usable to initialize a second cache to store timestamps. In particular, functions that operated on sysdb->ldb now operate on a generic ldb context so that a new ldb_ts context can be used later. Existing functions that initialize the sysdb cache call the generic functions with sysdb->ldb as a parameter. Splits out a function to initialize an empty ldb database with a generic LDIF. Splits out the sysdb upgrade function because the upgrade will only be used by the sysdb cache, the timestamp cache will start with a different version and might receive separate upgrade functions in the future. The ldb connection function accepts ldb flags parameter, currently unused. Reviewed-by: Sumit Bose <sbose@redhat.com>
* SYSDB: Index the objectSIDString attributeJakub Hrozek2015-08-191-0/+50
| | | | Reviewed-by: Michal Židek <mzidek@redhat.com>
* sysdb: use sysdb_user/group_dnPavel Březina2015-03-091-6/+3
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sysdb: make canonicalUserPrincipalName case-insensitiveSumit Bose2014-06-201-0/+56
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Update debug level in sysdb_check_upgrade_02Nikolai Kondrashov2014-02-121-1/+1
| | | | | | | | | Update debug level passed to backup_file in sysdb_check_upgrade_02 to prepare for removal of old debug level support. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Update DEBUG* invocations to use new levelsNikolai Kondrashov2014-02-121-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a script 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 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Make DEBUG macro invocations variadicNikolai Kondrashov2014-02-121-64/+64
| | | | | | | | | | | | | | | | | | | | | | | | 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: 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>
* SYSDB: Drop the sysdb_ctx parameter from the autofs APIJakub Hrozek2013-11-151-1/+1
|
* Use functionm ldb_dn_get_linearized to format struct ldb_dnLukas Slebodnik2013-07-191-3/+6
|
* SYSDB: Expire group if adding ghost users fails with EEXISTJakub Hrozek2013-01-231-2/+36
|
* Pass the domain to upgrade functionsSimo Sorce2013-01-151-9/+11
|
* Add domain argument to sysdb autofs functionsSimo Sorce2013-01-151-1/+2
|
* Upgrade DB and move ranges into top level objectSimo Sorce2013-01-151-0/+111
|
* SYSDB: More debugging during the conversion to ghost usersJakub Hrozek2012-12-121-0/+9
| | | | | | | We've been hitting situations where the sysdb conversion failed. Unfortunately, the current code doesn't include enough debugging info to pinpoint the failing entries. This patch adds more DEBUG statements for each processed entry.
* Uninitialized pointer readMichal Zidek2012-11-281-1/+1
| | | | https://fedorahosted.org/sssd/ticket/1673
* Handle conversion to fully qualified usernamesSimo Sorce2012-11-191-0/+88
| | | | | | | 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.
* Simplify writing db update functionsSimo Sorce2012-11-191-421/+192
| | | | | | Add functions to automate setting versions numbers in the db, also decrease chances of error in copying and pasting code, by setting the version number only once when we commence the upgrade.
* SYSDB: Do not touch the member attribute during conversion to ghost usersJakub Hrozek2012-11-131-11/+0
| | | | | | | | | We attempted to delete the member attributes of groups that contained a particular user during the sysdb upgrade, but obviously, this cannot work for nested groups as the member attribute is present for direct parents only. As a result, we were getting failures during the upgrade. https://fedorahosted.org/sssd/ticket/1631
* SSH: Expire hosts in known_hostsJan Cholasta2012-10-051-0/+89
|
* AUTOFS: convert the existing autofs entries during a sysdb upgradeJakub Hrozek2012-09-241-0/+134
|
* Fix the 0.11 sysdb upgradeJakub Hrozek2012-06-051-26/+26
| | | | | The block that upgraded the version was at a wrong indentation level, so it never ran if there were no fake users to convert
* Ghost members - sysdb upgrade routineJan Zeleny2012-05-311-0/+147
| | | | | | | | | | | | 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: Handle upgrade script failures betterStephen Gallagher2012-05-031-4/+13
| | | | | | There was a bug in finish_upgrade() where it would return EOK if it succeeded in canceling the transaction due to an error. We should instead be returning the original error.
* SYSDB: index sudoUserJakub Hrozek2012-01-311-0/+88
| | | | | Most of the the searches in the Sudo responder include the sudoUser attribute. Indexing it will make the responder faster.
* SYSDB: Add indexes for servicePort and serviceProtocolStephen Gallagher2012-01-271-0/+92
|
* Fix FTBFS related to -Werror=format-securityKrzysztof Klimonda2011-11-211-1/+1
|
* SYSDB: add index for nameAliasStephen Gallagher2011-11-021-0/+86
|
* SYSDB: New source file for sysdb upgrade routinesStephen Gallagher2011-10-071-0/+896