summaryrefslogtreecommitdiff
path: root/src/providers/ldap/sdap_sudo.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-11Fix formating of variables with type: time_tLukas Slebodnik1-2/+2
2013-08-19sudo: continue if we are unable to resolve fqdnPavel Březina1-1/+0
https://fedorahosted.org/sssd/ticket/2043
2013-06-07LDAP: sdap_id_ctx might contain several connectionsJakub Hrozek1-3/+3
With some LDAP server implementations, one server might provide different "views" of the identites on different ports. One example is the Active Directory Global catalog. The provider would contact different view depending on which operation it is performing and against which SSSD domain. At the same time, these views run on the same server, which means the same server options, enumeration, cleanup or Kerberos service should be used. So instead of using several different failover ports or several instances of sdap_id_ctx, this patch introduces a new "struct sdap_id_conn_ctx" that contains the connection cache to the particular view and an instance of "struct sdap_options" that contains the URI. No functional changes are present in this patch, currently all providers use a single connection. Multiple connections will be used later in the upcoming patches.
2013-01-21Add be_req_get_data() helper funciton.Simo Sorce1-2/+2
In preparation for making struct be_req opaque.
2013-01-21Add be_req_get_be_ctx() helper.Simo Sorce1-1/+2
In preparation for making be_req opaque
2013-01-21Remove sysdb as a be context structure memberSimo Sorce1-3/+3
The sysdb context is already available through the 'domain' structure.
2013-01-15Add domain arguments to sysdb sudo functionsSimo Sorce1-2/+7
2013-01-07sudo smart refresh: fix debug messagePavel Březina1-1/+1
2013-01-07sudo smart refresh: do not include usn in filter if no valid usn is knownPavel Březina1-5/+12
https://fedorahosted.org/sssd/ticket/1736 When there are no rules during first refresh, we don't have valid USN value. We use 0 in this case, but it turned out that OpenLDAP takes it as invalid time format (if modifyTimestamp is used instead of USN) and thus returns no records. Now we don't include USN/modifyTimestamp attribute in the filter if such situasion occurs.
2013-01-04LDAP: initialize refresh function handlerOndrej Kos1-1/+1
2012-12-19Add default section to switch statementSumit Bose1-0/+3
switch statements should always have a default section. In this particular case gcc gave a "'send_fn' may be used uninitialized in this function" warning.
2012-12-18sudo: do full refresh when data provider is back onlinePavel Březina1-7/+72
https://fedorahosted.org/sssd/ticket/1689 Add a online callback if the first full refresh fails due to the provider beeing offline so we can perform the refresh as soon as possible.
2012-12-18sudo: schedule another full refresh in short interval if the first failsPavel Březina1-0/+27
https://fedorahosted.org/sssd/ticket/1689 If the first full refresh of sudo rules fails because the data provider is offline, we will schedule another one in 2, 4, ... minutes.
2012-12-18check dp error in sdap_sudo_full_refresh_done()Pavel Březina1-3/+8
https://fedorahosted.org/sssd/ticket/1689
2012-12-18add sdap_sudo_schedule_refresh()Pavel Březina1-43/+71
Reduces amount of code duplication.
2012-12-11sudo: don't get stuck in rules and smart refresh when offlinePavel Březina1-4/+14
https://fedorahosted.org/sssd/ticket/1682 The problem was in following code: if (ret != EOK || state->dp_error != DP_ERR_OK || state->error != EOK) { tevent_req_error(req, ret); return; } In situation when data provider error occurs (e.g. when offline), ret == EOK but dp_error != DP_ERR_OK and we take the true branch. This results in calling tevent_req_error(req, EOK). Unfortunately, with EOK tevent_req_error only returns false, but does not trigger callback and this tevent request hangs forever, because no tevent_req_done(req) is called.
2012-12-07SUDO: strdup the input variableJakub Hrozek1-1/+1
https://fedorahosted.org/sssd/ticket/1701
2012-11-16fix -O3 variable may be uninitialized warningsPavel Březina1-2/+2
2012-11-15sudo: store rules with no sudoHost attributePavel Březina1-0/+7
https://fedorahosted.org/sssd/ticket/1640 Normal rules requires that sudoHost attribute is present. But this attribute is not mandatory for a special rule named cn=defaults. This patch modifies filter so that we store even rules that doesn't have sudoHost attribute specified. SUDO will then decide whether it is allowed or not.
2012-10-24sudo refresh: handle errors properlyPavel Březina1-8/+25
We should test both ret and (dp_error, errno) pair.
2012-10-24sudo: do not fail if usn value is zero but full refresh is completedPavel Březina1-7/+17
https://fedorahosted.org/sssd/ticket/1596 In case that LDAP server contains zero sudo rules, the full refresh completes succussfully and stores current USN value (= 0). But then smart refresh will fail because it takes USN=0 as invalid value.
2012-10-03Variable in sdap_sudo_rules_refresh_send could be used, uninitialized.Michal Zidek1-0/+1
2012-08-07Rename SYSDB_SUDO_CACHE_AT_OC to SYSDB_SUDO_CACHE_OCPavel Březina1-2/+2
It does not contain name of the object class attribute but the value itself. I renamed it to avoid confusion.
2012-07-23sdap_sudo.c: add missing end of line in few debug messagesPavel Březina1-3/+3
2012-07-18Fix uninitialized valuesNick Guay1-6/+6
https://fedorahosted.org/sssd/ticket/1379
2012-07-09Fix uninitialized variableStephen Gallagher1-0/+1
Coverity #12802
2012-06-29sudo ldap provider: do per-host updatesPavel Březina1-3/+160
Add host information to LDAP filters.
2012-06-29sudo ldap provider: mark sdap_sudo_setup_periodical_refresh() as staticPavel Březina1-2/+2
2012-06-29sudo ldap provider: load host filter configuration on initPavel Březina1-3/+52
We need to load host information during provider initialization. Currently it loads only values from configuration files, but it is implemented as an asynchrounous request as it will later try to autodetect these settings (which will need to contact DNS).
2012-06-29sudo ldap provider: pass sudo_ctx instead of id_ctxPavel Březina1-39/+57
I had to create a new context structure to store additional information such as ip addresses and hostnames.
2012-06-29sdap_sudo.c: move _recv after _donePavel Březina1-45/+45
2012-06-29sudo ldap provider: modify highest USN in sdap_sudo_rules_refresh_done()Pavel Březina1-3/+14
2012-06-29sudo ldap provider: notify responder when an expired rule has been deletedPavel Březina1-11/+76
When an expired rule is not present on the server server during specific rule refresh, the provider will notify the sudo responder that it has been deleted. Because there is a high probability that some other rules were deleted from the server as well, we want to remove them from sysdb as soon as possible. Once the responder is notified, it will schedule an out of band full refresh. This is issued by responder, because we already have a mechanism that prohibits creation of similar request (i.e. once the OOB full refresh is scheduled, there won't be another). The notification is done by returning: DP error = DP_ERR_OK, error = ENOENT
2012-06-29sudo ldap provider: return number of downloaded rules in ↵Pavel Březina1-4/+6
sdap_sudo_refresh_recv()
2012-06-29sudo ldap provider: support periodical smart refreshPavel Březina1-73/+177
When SSSD is started, then full refresh is scheduled. The smart refresh is scheduled after this full refresh, if USN (or modifyTimestamp) values are available. If full refresh interval <= smart refresh interval then full refresh will be disabled. If both refresh types are 0 then smart refresh interval is set to default value.
2012-06-29sudo ldap provider: add periodical smart refresh APIPavel Březina1-0/+63
2012-06-29sudo ldap provider: add smart refresh APIPavel Březina1-0/+128
2012-06-29sudo ldap provider: remember highest usn after full refreshPavel Březina1-1/+9
2012-06-29sudo ldap provider: add sdap_sudo_set_usn()Pavel Březina1-0/+22
2012-06-29sudo ldap provider: find highest USNPavel Březina1-2/+3
2012-06-29sudo ldap provider: support periodical full refreshPavel Březina1-0/+129
2012-06-29sudo provider: remove old timerPavel Březina1-67/+0
2012-06-29sudo ldap provider: add support for on demand refresh of specific rulesPavel Březina1-0/+8
2012-06-29sudo ldap provider: provide API for refresh of specific rulesPavel Březina1-0/+93
2012-06-29sudo ldap provider: add support for on demand full refreshPavel Březina1-16/+25
2012-06-29sudo ldap provider: provide API for full refreshPavel Březina1-0/+125
2012-06-29sudo ldap provider: give sdap_sudo_refresh_send() search and purge filtersPavel Březina1-2/+2
2012-06-29sudo ldap provider: move async routines to sdap_async_sudo.cPavel Březina1-675/+0
2012-05-31Add support for filtering atributesJan Zeleny1-1/+1
This patch adds support for filtering attributes when constructing attribute list from a map for LDAP query.
2012-05-10LDAP: Add attr_count return value to build_attrs_from_map()Stephen Gallagher1-1/+1
This is necessary because in several places in the code, we are appending to the attrs returned from this value, and if we relied on the map size macro, we would be appending after the NULL terminator if one or more attributes were defined as NULL.