summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* IPA: format fixesSumit Bose2017-09-012-2/+2
| | | | | | | | | | | There are format warnings when compiling on 32bit. One is about time_t where %ld should be used and the other is about size_t where %zu should be used. Related to https://pagure.io/SSSD/sssd/issue/2995 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* PYTHON: Define constants as bytes instead of stringsFabiano Fidêncio2017-08-311-0/+7
| | | | | | | | | | | | | | | When using python3 getsidbyname() and getnamebysid() expect the key as bytes instead of strings, and currently those are defined as strings. So, in order to avoid people working around this by doing `pysss_nss_idmap.SID_KEY.encode('utf-8')` let's make their life easier and properly have those constants defined as bytes. Resolves: https://pagure.io/SSSD/sssd/issue/3491 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Michal Židek <mzidek@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SDAP: Don't call be_mark_offline() because ↵Fabiano Fidêncio2017-08-311-0/+8
| | | | | | | | | | | | | | sdap_id_conn_data_set_expire_timer() failed Marking the whole backend as offline because sdap_id_conn_data_set_expire_timer() failed doesn't look any right and from now on let's avoiding doing so. Related: https://pagure.io/SSSD/sssd/issue/2976 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SDAP: Add a debug message to explain why a backend was marked offlineFabiano Fidêncio2017-08-311-0/+4
| | | | | | | | | | | This new debug message may help us when debugging the cases where a backend was marked offline but it shouldn't be. Related: https://pagure.io/SSSD/sssd/issue/2976 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* CONFDB: Do not crash with an invalid domain_type or case_sensitive valueJakub Hrozek2017-08-311-0/+2
| | | | | | | | | | | If the domain_type parameter contained an invalid value, the error branch wouldn't have set the 'ret' parameter to an error condition, which might crash sssd. The same problem occured with CONFDB_DOMAIN_CASE_SENSITIVE Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* CONFDB: Set a default value for subdomain_refresh_interval in case an ↵Fabiano Fidêncio2017-08-302-2/+12
| | | | | | | | | | | invalid value is set The code as it was seemed wrong as when an invalid value as set we neither error out nor set a default valid value there. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: add unit tests for krb5 localauth pluginSumit Bose2017-08-281-0/+197
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* localauth plugin: change return code of sss_an2lnSumit Bose2017-08-281-1/+1
| | | | | | | | | | | | | It is expected that the an2ln plugin function returns KRB5_LNAME_NOTRANS to indicate that no mapping can be determined and other an2ln methods can be tried. Currently SSSD's localauth plugin returns KRB5_PLUGIN_NO_HANDLE which sould only be used for the userok plugin function. Resolves https://pagure.io/SSSD/sssd/issue/3459 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* TESTS: Add regression tests to try if resolving root and ID 0 fails as expectedJakub Hrozek2017-08-281-0/+21
| | | | Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* TESTS: Add files provider tests that request a user and group by IDJakub Hrozek2017-08-281-6/+91
| | | | Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* TESTS: Add wrappers to request a user or a group by IDJakub Hrozek2017-08-282-2/+84
| | | | Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* TEST_NEGCACHE: Ensure root's uid and gid are always added to ncacheFabiano Fidêncio2017-08-281-0/+24
| | | | | | | | | | | | In order to do so two new functions have been introduced and test_sss_ncache_prepopulate() has been modified in order to ensure that root's uid and gid are always added to the negative cache. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* NEGCACHE: Add root's uid/gid to ncacheFabiano Fidêncio2017-08-281-0/+17
| | | | | | | | | | | | | | | | | As "root" is not handled by SSSD, let's add its uid and gid to the negative cache as well. The reason it's added without specifying a domain is to follow how the negative cache is used by cache req's code when searching something by id. As the negative cache check for uid/gid, in the cache req code, is done after resolving the name, we can save one LDAP call to the data provider. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* NSS: Don't error out when deleting an entry which has id = 0 from the memcacheFabiano Fidêncio2017-08-281-0/+6
| | | | | | | | | | | | | | | This code path can be easily triggered by calling `id 0` after applying the previous patch in this series and SSSD should not error out in this case. As SSSD doesn't handle "root", this entry never will be part of the memcache and EOK can be safely returned there. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* CACHE_REQ: Don't error out when searching by id = 0Fabiano Fidêncio2017-08-281-6/+0
| | | | | | | | | | | | | | This code path can be easily triggered by calling `id 0` and SSSD should not error out in this case. Previous patches in this series already add uid and gid 0 to the negative cache and we can properly handle this situation. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* NEGCACHE: Descend to all subdomains when adding user/groupsFabiano Fidêncio2017-08-281-2/+6
| | | | | | | | | | | When a user or group is added to the negative cache, we should descend to all subdomains as well. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TEST_NEGCACHE: Test that "root" is always added to ncacheFabiano Fidêncio2017-08-281-0/+6
| | | | | | | | | | | | | Simply modify test_sss_ncache_prepopulate() in order to ensure that "root" user and group are always added to the negative cache, no matter whether they're set as part of the filter_users or filter_groups options. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* NEGCACHE: Always add "root" to the negative cacheFabiano Fidêncio2017-08-281-34/+54
| | | | | | | | | | | | | | The current code only adds "root" to the negative cache in case there's any other user or group set up in to be added. As SSSD doesn't handle "root", it should *always* be added to the negative cache. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* NEGCACHE: Add some comments about each step of sss_ncache_prepopulate()Fabiano Fidêncio2017-08-281-1/+4
| | | | | | | | | | | The comments help to understand which part of the code is dealing with users or groups of specific or non-specific domain filters. Related: https://pagure.io/SSSD/sssd/issue/3460 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* DESKPROFILE: Add ipa_deskprofile_request_intervalFabiano Fidêncio2017-08-288-1/+53
| | | | | | | | | | | | | | | | This option has been added to avoid contacting the Data Provider when no rules were found in the previous request. By adding this configurable option we avoid contacting the Data Provider too often in the case described above and also when the server doesn't support Desktop Profile's integration. Resolves: https://pagure.io/SSSD/sssd/issue/3482 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Not having rules should not be logged as errorFabiano Fidêncio2017-08-281-1/+1
| | | | | | | | | Let's tone down the debug level to TRACE_FUNC instead of MINOR_FAILURE. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Add a debug message in case ipa_hbac_rule_info_next() failsFabiano Fidêncio2017-08-281-0/+1
| | | | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Enforce coding style ipa_hbac_rule_info_recv()Fabiano Fidêncio2017-08-282-6/+6
| | | | | | | | | By convention, the output variables are prefixed with a underscore. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Enforce coding style on ipa_hbac_rule_info_send()Fabiano Fidêncio2017-08-281-1/+1
| | | | | | | | | | Use if-else if-else statements instead of using severel different if statements. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Improve readability of ipa_hbac_rule_info_send()Fabiano Fidêncio2017-08-281-12/+11
| | | | | | | | | | | Move an if condition inside another if condition in order to make the readability a little bit more clear that those checks are about the same return code. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Remove a cosmetic extra space from an if clauseFabiano Fidêncio2017-08-281-1/+1
| | | | | | | Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Document ipa_hbac_rule_info_next()'s behaviourFabiano Fidêncio2017-08-281-0/+8
| | | | | | | | | | | Let's add a comment on ipa_hbac_rule_info_send() in order to have cleaner why ret is set to EINVAL when ipa_hbac_rule_info_next() returns EOK. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* HBAC: Fix tevent hierarchy in ipa_hbac_rule_info_send()Fabiano Fidêncio2017-08-281-24/+15
| | | | | | | | | | | | | | | The first thing a _send() function should o is call `tevent_req_create()` in order to create both the state and the request and then use the state as context for temporary data. Also, `tevent_req_create()` should be only function returning NULL from the _send function, while all the other calls should goto immediate and return the proper error, as they have a valid request. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* DESKPROFILE: Introduce the new IPA session providerFabiano Fidêncio2017-08-2826-2/+2695
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to provide FleetCommander[0] integration, a session provider has been introduced for IPA. The design of this feature and more technical details can be found at [1] and [2], which are the design pages of both freeIPA and SSSD parts. As there's no way to test freeIPA integration with our upstream tests, no test has been provided yet. Is also worth to mention that the name "deskprofile" has been chosen instead of "fleetcmd" in order to match with the freeIPA plugin. It means that, for consistence, all source files, directories created, options added, functions prefixes and so on are following the choice accordingly. [0]: https://wiki.gnome.org/Projects/FleetCommander [1]: https://github.com/abbra/freeipa-desktop-profile/blob/master/plugin/Feature.mediawiki [2]: https://docs.pagure.org/SSSD.sssd/design_pages/fleet_commander_integration.html Resolves: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* UTIL: Add sss_create_dir()Fabiano Fidêncio2017-08-283-0/+119
| | | | | | | | | | | | | | | | | The newly added function helps us to create a new dir avoiding a possible TUCTOU issue. It's going to be used by the new session provider code. A simple test for this new function has also been provided. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* UTIL: move {files,selinux}.c under util directoryFabiano Fidêncio2017-08-288-42/+40
| | | | | | | | | | | | | | | | | | | | | | | | | files.c has at least one function that will be re-used for the new session provider that's about to be added. Also, a few other functions may be added and files.c seems the right place for those. selinux.c has been moved together with files.c as the latter takes advantage of some functions from the former and we do not want to always link agains the tools code. The public functions from files.c got a "sss_" prefix and it has been changed whenever they're used. Last but not least, all the places that included "tools/tools_util.h" due to the functions on files.c had this include removed (as they were already including "util/util.h". Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_COMMON: Introduce ipa_get_host_attrs()Fabiano Fidêncio2017-08-283-29/+55
| | | | | | | | | | | | | By adding this method it can reused in the future for new backend modules. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_ACCESS: Make use of struct ipa_common_entriesFabiano Fidêncio2017-08-281-82/+41
| | | | | | | | | | | | Just by doing so ipa_save_hbac() can be completely removed. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_RULES_COMMON: Introduce ipa_common_get_hostgroupname()Fabiano Fidêncio2017-08-285-117/+118
| | | | | | | | | | | | | | | | | By moving the get_ipa_hostgroupname() method from ipa_hbac_hosts.[ch] to ipa_rules_common.[ch] it can be used by both HBAC and, in the future, for new backend modules. The method got renamed to ipa_common_get_hostgroupname() and some coding style changes have been made in order to match with what SSSD follows. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_RULES_COMMON: Introduce ipa_common_save_rules()Fabiano Fidêncio2017-08-283-60/+149
| | | | | | | | | | | | | | | | | | | | | This method is kind of a replacement for ipa_save_hbac() one. While ipa_save_hbac() wasn't removed, its porpuse has been totally changed. Now it just prepare the ground and calls ipa_common_save_rules() which is a more generic function that can be reused for new backend modules. In order to make the code cleaner a new structure has also been introduced: struct ipa_common_entries; which contains the values that will be used to save the entry and the entrygroup to sysdb. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_ACCESS: Make ipa_purge_hbac() more genericFabiano Fidêncio2017-08-283-33/+38
| | | | | | | | | | | | | | | | This mothod can also be reused in the future for new backend modules. In order to make it more generic, let's just move it to ipa_rules_common.[ch], rename it to ipa_common_purge_rules() and make the subtreename to be purged a new paramether of this method. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_ACCESS: Make hbac_get_cache_rules() more genericFabiano Fidêncio2017-08-287-77/+141
| | | | | | | | | | | | | | | | | | | | | This method can also be reused in the future for new backend modules. In order to make it more generic, let's just move it to ipa_rules_common.[ch], rename it to ipa_common_get_cached_rules() and make the rule, subtree name and the attributes to be searched new parameters of this method. In order to not be declaring the enourmous list of attributes HBAC uses when calling this method, a new hbac_get_attrs_to_get_cached_rules() method has been introduced. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: Leave only HBAC specific defines in ipa_hbac_private.hFabiano Fidêncio2017-08-288-11/+18
| | | | | | | | | | | | | The defines that were moved can and will be used by another backend module that will be introduced in the near future. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: Make ipa_hbac_sysdb_save() more genericFabiano Fidêncio2017-08-285-153/+228
| | | | | | | | | | | | | | | | | | | Although there's no change in the ipa_hbac_sysdb_save() itself, its name has been changed to ipa_common_entries_and_groups_sysdb_save() and its been split out from HBAC related files and moved to the newly created ipa_rules_common.[ch] files, which will also be used in the future for new backend modules. ipa_rules_common.[ch] is not exactly the best name for those files, IMO, but I really cannot come up with something better. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA_ACCESS: Remove not used attributeFabiano Fidêncio2017-08-282-3/+0
| | | | | | | | | | | | | struct time_rules_ctx * is not used anywhere in in the access handler, thus there's no need to store it. Related: https://pagure.io/SSSD/sssd/issue/2995 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IFP: Don't pre-allocate the amount of entries requestedFabiano Fidêncio2017-08-251-7/+9
| | | | | | | | | | | | | | | | | | | | | | By allocating the number of entries when actually copying the list we can avoid situations where users request an enourmous amount of results but the number of results got from the backend are just a few. With this new approach we end up allocating the whole list more frequently but we avoid not returning valid results because the requested number of enties is too big (note that if the amount of results is too big as well, there's nothing much we can do). A simple reproducer for this issue can be the really extreme call: $ dbus-send --system --print-reply --dest=org.freedesktop.sssd.infopipe \ /org/freedesktop/sssd/infopipe/Users \ org.freedesktop.sssd.infopipe.Users.ListByName string:"*" uint32:"-1" The example pasted above would try to allocate an array of MAX_UINT32 size, which would fail directly. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: Change ifp_list_ctx_remaining_capacity() return typeFabiano Fidêncio2017-08-254-15/+47
| | | | | | | | | | | | Now ifp_list_ctx_remaining_capacity() returns an errno_t and receives the count as an output parameter. It allows better handling and error reporting in case something goes wrong internally in this function. Related: https://pagure.io/SSSD/sssd/issue/3306 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: Fix of limit = 0 (unlimited result)Petr Čech2017-08-251-0/+9
| | | | | | | | | | | | | If we set limit to 0 it means that result is unlimited. Internally we restrict number of result by allocation of result array. In unlimited case there was a bug and zero array was allocated. This fix allocates neccessary array when we know real result size. Resolves: https://pagure.io/SSSD/sssd/issue/3306 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: Filter with * in infopipe group methodsPetr Čech2017-08-251-11/+15
| | | | | | | | | | | This patch fixes asterisk in filter of the ListByName Groups' method, which ends up calling ifp_groups_list_copy() with a NULL pointer. Resolves: https://pagure.io/SSSD/sssd/issue/3305 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: fix typo in option name in man pagesPavel Březina2017-08-252-2/+2
| | | | Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* ldap_child: Removing duplicate log messageAmitKumar2017-08-251-13/+5
| | | | | | | | | | | Duplicate log messages were getting logged if trust relationship breaks for some reason from AD. That causes lot spam in syslog. This PR removes duplicate log entry and keeps extended log entry. Resolves: https://pagure.io/SSSD/sssd/issue/3450 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* libwbclient: Fix warning statement with no effectLukas Slebodnik2017-08-221-1/+1
| | | | | | | | | | | | | | | src/sss_client/libwbclient/wbc_pam_sssd.c: In function ‘wbcAuthenticateUserEx’: src/sss_client/libwbclient/wbc_pam_sssd.c:52:5: error: statement with no effect [-Werror=unused-value] WBC_ERR_WINBIND_NOT_AVAILABLE; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/sss_client/libwbclient/wbc_pam_sssd.c:53:1: error: control reaches end of non-void function [-Werror=return-type] } ^ Related to: https://pagure.io/SSSD/sssd/issue/3461 Reviewed-by: Sumit Bose <sbose@redhat.com>
* libwbclient: Change return code for wbcAuthenticateUserExLukas Slebodnik2017-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba-4.6 change behaviour of few functions New version of code make sure session info for user is stored in cache. It is a performance optimisation to prevent contacting KDC for each session. More details in samba bug https://bugzilla.samba.org/show_bug.cgi?id=11259 Old return code WBC_SSSD_NOT_IMPLEMENTED was translated to NT_STATUS_LOGON_FAILURE which caused many failures. [2017/08/21 11:34:15.044321, 5, pid=27742, effective(0, 0), real(0, 0)] ../libcli/security/security_token.c:53(security_token_debug) Security token: (NULL) [2017/08/21 11:34:15.044330, 5, pid=27742, effective(0, 0), real(0, 0)] ../source3/auth/token_util.c:640(debug_unix_user_token) UNIX token of user 0 Primary group is 0 and contains 0 supplementary groups [2017/08/21 11:34:15.044349, 4, pid=27742, effective(0, 0), real(0, 0)] ../source3/smbd/sec_ctx.c:439(pop_sec_ctx) pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0 [2017/08/21 11:34:15.044360, 1, pid=27742, effective(0, 0), real(0, 0)] ../source3/smbd/sesssetup.c:290(reply_sesssetup_and_X_spnego) Failed to generate session_info (user and group token) for session setup: NT_STATUS_LOGON_FAILURE Resolves: https://pagure.io/SSSD/sssd/issue/3461 Reviewed-by: Sumit Bose <sbose@redhat.com>
* sudo: add a threshold option to reduce size of rules refresh filterPavel Březina2017-08-188-5/+56
| | | | | | | | | | | | | If a large number of rules is expired at one time the ldap filter may become too large to be processed by server. This commits adds a new option "sudo_threshold" to sudo responder. If the threshold is exceeded a full refreshed is done instead of rules refresh. Resolves: https://pagure.io/SSSD/sssd/issue/3478 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
* intg: Increase startup timeouts for kcm and secretsLukas Slebodnik2017-08-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | In cwrap environment, we start sssd_kcm and sssd_secrets ourself and not by systemd socket activation. Our approach is to wait a second in a loop till socket is available. However sometimes 1 second is not enough. Patch increases wait timeout from 1 second to 10 and it seems to be enough even when processes were executed with valgrind. Traceback (most recent call last): File "src/tests/intg/test_secrets.py", line 419, in setup_for_cli_timeout_test return create_sssd_secrets_fixture(request) File "src/tests/intg/test_secrets.py", line 82, in create_sssd_secrets_fixture assert os.path.exists(sock_path) AssertionError: assert False + where False = <function exists at 0x7f6c1cf520c8>('/tmp/sssd-intg.cdv0namx/var/run/secrets.socket') + where <function exists at 0x7f6c1cf520c8> = <module 'posixpath' from '/usr/lib64/python2.7/posixpath.pyc'>.exists + where <module 'posixpath' from '/usr/lib64/python2.7/posixpath.pyc'> = os.path Resolves: https://pagure.io/SSSD/sssd/issue/3481 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>