summaryrefslogtreecommitdiff
path: root/src/db
AgeCommit message (Collapse)AuthorFilesLines
2013-01-15Refactor sysdb initializationSimo Sorce2-145/+13
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.
2013-01-15The Big sysdb/domain split-up!Simo Sorce1-1/+1
This commit is the first of a complex work of untangling domain and sysdb. It turns out the idea of keeping a reference to the domain within the sysdb was a poor one so we need to split the domain out and change all functions that needs one to get it explicitly from their callers.
2013-01-10Change pam data auth tokens.Simo Sorce1-1/+0
Use the new authtok abstraction and interfaces throught the code.
2013-01-10Code can only check for cached passwordsSimo Sorce2-13/+2
Make it clear to the API users that we can not take arbitrary auth tokens. We can only take a password for now so simplify and clarify the interface.
2013-01-10Use sysdb_search_service() for all svc queriesSimo Sorce2-78/+56
2013-01-10Add sysdb_search_service() helper functionSimo Sorce2-0/+63
2013-01-08Remove dead netgroup functionsSimo Sorce2-155/+0
2013-01-08SYSDB: Split a function to read all SELinux mapsJakub Hrozek2-23/+49
2013-01-08SYSDB: Remove duplicate selinux definesJakub Hrozek2-5/+1
2013-01-08Translate LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS to EEXISTSumit Bose1-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.
2013-01-07SYSDB: split sysdb_add_userOndrej Kos1-125/+176
The function itself was very long (more than 300 lines) and hard to read, this patch splits it to three logical blocks.
2013-01-07SYSDB: Modify ghosts in permissive modeOndrej Kos1-1/+33
https://fedorahosted.org/sssd/ticket/1714 The attempt to delete all ghosts for users name and aliases was failing, resulting into failure of whole user-add operation. In permissive mode, the attempts to delete non-existent entries are not interpreted as error.
2013-01-07Remove redundant definition.Simo Sorce2-2/+1
We had 2 defines for the same class. Consolidate and remove confusion.
2012-12-19Fix a 'shadows a global declaration' warningSumit Bose1-2/+2
2012-12-18SYSDB: Add API to invalidate all map objectsJakub Hrozek2-0/+94
This sysdb API will be used later to invalidate the autofs maps
2012-12-18SYSDB: fix copy-n-paste errorJakub Hrozek1-1/+1
2012-12-13sudo: support generalized time formatPavel Březina2-13/+34
https://fedorahosted.org/sssd/ticket/1712 The timestamp doesn't have to be in the form yyyymmddHHMMSSZ any more. It can be in any form of generalized time format.
2012-12-13sudo: include primary group in user group listPavel Březina1-1/+41
https://fedorahosted.org/sssd/ticket/1677
2012-12-13sysdb_get_sudo_user_info() initialize attrs on declarationPavel Březina1-4/+3
2012-12-12SYSDB: More debugging during the conversion to ghost usersJakub Hrozek1-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.
2012-12-10SYSDB: Move misplaced assignmentJakub Hrozek1-2/+1
2012-11-28Null pointer dereferenced.Michal Zidek1-96/+100
https://fedorahosted.org/sssd/ticket/1674
2012-11-28Uninitialized pointer readMichal Zidek1-1/+1
https://fedorahosted.org/sssd/ticket/1673
2012-11-23SYSDB: Don't operate with aliases same as nameOndrej Kos1-0/+6
fixes https://fedorahosted.org/sssd/ticket/1628 When user's alias is same as it's name, don't use it for searching in sysdb, and for deleting.
2012-11-20LDAP: Only convert direct parents' ghost attribute to memberJakub Hrozek3-9/+41
https://fedorahosted.org/sssd/ticket/1612 This patch changes the handling of ghost attributes when saving the actual user entry. Instead of always linking all groups that contained the ghost attribute with the new user entry, the original member attributes are now saved in the group object and the user entry is only linked with its direct parents. As the member attribute is compared against the originalDN of the user, if either the originalDN or the originalMember attributes are missing, the user object is linked with all the groups as a fallback. The original member attributes are only saved if the LDAP schema supports nesting.
2012-11-20SYSDB: Use the add_string convenience functions for managing ghost user ↵Jakub Hrozek1-24/+9
attribute Using the convenience function instead of low-level ldb calls makes the code more compact and more readable.
2012-11-19Handle conversion to fully qualified usernamesSimo Sorce3-1/+98
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.
2012-11-19Refactor the way subdomain accounts are savedSimo Sorce3-1/+52
The original sysdb code had a strong assumption that only users from one domain are saved in the databse, with the subdomain feature, we have changed reality, but have not adjusted all the code arund the sysdb calls to not rely on the original assumption. One of the side effects of this incongrunece is that currently group memberships do not return fully qualified names for subdomain users as they should. In oreder to fix this and other potential issues surrounding the violation of the original assumption, we need to fully qualify subdomain user names. By savin them fully qualified we do not risk aliasing local users and have group memberhips or other name based matching code mistake a domain user with subdomain usr or vice versa.
2012-11-19Simplify writing db update functionsSimo Sorce1-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.
2012-11-19Display more information on DB version mismatchOndrej Kos2-2/+64
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.
2012-11-19SYSDB: Remove unused macrosJakub Hrozek1-15/+0
2012-11-13SYSDB: Do not touch the member attribute during conversion to ghost usersJakub Hrozek1-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
2012-11-10Add pac_user_get_grp_info() to read current group membershipsSumit Bose1-0/+1
To be able to efficiently store group memberships we need to know the current memberships of a user. sysdb_initgroups() is used to read the user entry together with all groups the user is a member of. Some of the group attributes are kept to avoid additional lookups and speed up further processing. Currently sysdb_initgroups() does not return the original DN of the group. Since it is needed to remove memberships later on it is added to the list of requested attributes
2012-10-26sysdb: add sysdb_base_dn()Sumit Bose2-0/+5
Add a help function which returns the ldb_dn object for the base dn of the cache.
2012-10-26sysdb: look for ranges in the parent treeSumit Bose1-1/+4
Make sure the right sub-tree in the cache is used to search for ranges. Sub-domain trees do not have range objects only the tree of the parent domain.
2012-10-12SSH: When host keys are removed from LDAP, remove them from the cache as wellJan Cholasta1-36/+34
https://fedorahosted.org/sssd/ticket/1574
2012-10-05SSH: Expire hosts in known_hostsJan Cholasta5-3/+179
2012-10-05SSH: Refactor sysdb and related codeJan Cholasta2-85/+182
2012-10-01sysdb_master_domain_get_info: fix copy-and-paste errorSumit Bose1-2/+2
2012-09-24DB: Use TALLOC_CTX for talloc contextJakub Hrozek1-10/+10
A couple of sysdb functions used "void *" in place of a TALLOC_CTX.
2012-09-24SYSDB: Remove unnecessary domain parameter from several sysdb callsJakub Hrozek5-76/+58
The domain can be read from the sysdb object. Removing the domain string makes the API more self-contained.
2012-09-24AUTOFS: convert the existing autofs entries during a sysdb upgradeJakub Hrozek3-1/+144
2012-09-24AUTOFS: Use both key and value in entry RDNJakub Hrozek2-11/+40
This patch switches from using just key in the RDN to using both key and value. That is neccessary to allow multiple direct mounts in a single map.
2012-09-24AUTOFS: Add entry objects below map objectsJakub Hrozek4-146/+64
https://fedorahosted.org/sssd/ticket/1506 Changes how the new autofs entry objects are handled. Instead of creating the entry on the cn=autofs,cn=custom level, the entry is created below the map it belongs to.
2012-09-20DB: Cancel transaction in sysdb_store_user if sysdb_add_user failsJakub Hrozek1-1/+8
2012-09-20LDB_ERR_INVALID_ATTRIBUTE_SYNTAX added to sysdb_error_to_errno.Michal Zidek1-0/+2
2012-09-13SELinux: Always use the default if it exists on the serverJakub Hrozek1-2/+9
https://fedorahosted.org/sssd/ticket/1513 This is a counterpart of the FreeIPA ticket https://fedorahosted.org/freeipa/ticket/3045 During an e-mail discussion, it was decided that * if the default is set in the IPA config object, the SSSD would use that default no matter what * if the default is not set (aka empty or missing), the SSSD would just use the system default and skip creating the login file altogether
2012-09-13DB: Always write the SELinux object to sysdbJakub Hrozek1-70/+8
There's no point in checking if the object already exists because we always wipe the whole sysdb subtree. We were also immediatelly cancelling the transaction because we'd jump to goto, even though it was with EOK.
2012-09-10SYSDB: NULL-terminate the output of sysdb_get_{ranges,subdomains}Jakub Hrozek2-2/+5
2012-09-05SYSDB: Commit transaction in sysdb_store_userJakub Hrozek1-17/+19