summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* TOOLS: New helper tool sss_signalJakub Hrozek2014-07-083-1/+50
| | | | | | | | A minimal tool whose only purpose is to signal the monitor with SIGUSR2. The tool will be executed by the system bus in order to provide system activation, so it's packaged in libexec. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* MONITOR: Signal InfoPipe to reconnect on SIGUSR2Jakub Hrozek2014-07-081-0/+9
| | | | | | | | When the monitor receives SIGUSR2, it also signals the IFP responder to attempt to reconnect to the system bus using the sysbusReconnect SBUS method. No action is taken by other responders. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: Provide a SBUS method to reconnect to sysbusJakub Hrozek2014-07-0811-1/+58
| | | | | | | | | Introduces a new method implemented only by the IFP responder. When this method is received, the responder attempts to reconnect to the system bus, if not connected already. Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Pavel Reichl <preichl@redhat.com>
* IFP: Return a specific value on failure connecting to the system busJakub Hrozek2014-07-083-2/+8
| | | | | | | | We need to treat the failure to connect to the system bus as non-fatal. In this commit, we introduce a special error code and only print a DEBUG message when this error code is returned from the startup function. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: Fix DEBUG messagesJakub Hrozek2014-07-081-7/+9
| | | | | | | The DEBUG messages in the IFP responder predated Nikolai's mass-patches and were not converted correctly. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* BUILD: dbusintrospectdir is not used anymoreJakub Hrozek2014-07-081-3/+0
| | | | | | | We fprintf the introspection data on demand rather than printing an XML file. The directory specification can be removed. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* SDAP: Free bervals on failure in sdap_parse_entryJakub Hrozek2014-07-081-2/+10
| | | | Reviewed-by: Michal Židek <mzidek@redhat.com>
* SDAP: Remove unused function sdap_get_msg_dnJakub Hrozek2014-07-082-34/+0
| | | | | | | This function was not used since 2009. Unused and untested function would just rot, better to remove it completely. Reviewed-by: Michal Židek <mzidek@redhat.com>
* LDAP: Remove unused output parameter _dn from sdap_parse_entryJakub Hrozek2014-07-084-24/+13
| | | | | | | No caller directly accessed this parameter. Moreover, it seemed useless since the same data is available as SYSDB_ORIGINAL_DN in the attributes. Reviewed-by: Michal Židek <mzidek@redhat.com>
* SDAP: Fix DEBUG message priorities in sdap_parse_entryJakub Hrozek2014-07-081-13/+13
| | | | | | | | | While I was changing the sdap_parse_entry function, I also realized that some of the DEBUG messages were converted to the #defines, but their level was still not accurate. This patch fixes the DEBUG levels and indentation around them. Reviewed-by: Michal Židek <mzidek@redhat.com>
* LDAP: Try all attributes when saving an entryJakub Hrozek2014-07-082-3/+79
| | | | | | | | | | | | | The same LDAP attribute might be used several times for the same user or group attribute. For instance, some servers have a global "ID" number that should be used for both UID and GID. However, our sdap_parse_entry() function only copied the LDAP attribute to the first matching sysdb attribute. This patch adds a second nested loop that checks if any of the other LDAP attributes are eligible. Reviewed-by: Michal Židek <mzidek@redhat.com>
* TESTS: Add a unit test for the sdap.c moduleJakub Hrozek2014-07-082-1/+562
| | | | | | | | Covers the sdap_parse_entry function with unit tests so that we know that modifying the function in a later patch will not result in a regression. Reviewed-by: Michal Židek <mzidek@redhat.com>
* PROVIDERS: Add ldap_common.h to opts.h of each providerJakub Hrozek2014-07-083-0/+3
| | | | | | | | the opts.h files were consuming some #defines from ldap_common.h (such as SSS_LDAP_SRV_NAME) without including ldap_common.h. That's bad practice and break programs that wish to just include the opts.h header. Reviewed-by: Michal Židek <mzidek@redhat.com>
* UTIL: Fix access out of bound in parse_argsLukas Slebodnik2014-07-082-17/+39
| | | | | | | | | | | | | | | | While parsing string with multiple whitespaces, it may happen variable i is zero and we want to test end of argument "tmp[i-1] != '\0'". Side effect of this bug is duplicite string output array. Input string: "foo b" Expected output: { "foo", "a", NULL } Output: { "foo", "foo", "a", NULL } This patch uses inverted logic. Instead of testing whether to read next char or skip multiple whitespaces, we will test whether we have new argument which should be stored in output array. Reviewed-by: Pavel Reichl <preichl@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: Do not rely on order of hash itemsJakub Hrozek2014-07-071-32/+50
| | | | | | | | | The nested group test was checking returned elements in a particular order. That's not reliable because the returned values are fetched from a hash iterator that doesn't guarantee the same order on different systems. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* SPEC: Add gpo_child to package sssd-adLukas Slebodnik2014-07-011-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* BUILD: ad_gpo_tests should be built only with sambaLukas Slebodnik2014-07-011-2/+3
| | | | Reviewed-by: Sumit Bose <sbose@redhat.com>
* sbus_request: fix potential NULL dereferencePavel Březina2014-07-012-5/+10
| | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Add more tests for nested groups processingJakub Hrozek2014-07-011-1/+265
| | | | | | | | | | Adds unit test for basic group retrieval functionality as well as for testing duplicate members in the LDAP group entry. These unit tests exercise code added in patch a47cb2e08e4004179d2a6b5f9a9340200270fbd0 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Change how mock_sysdb_user() is implementedJakub Hrozek2014-07-012-3/+16
| | | | | | | For the purpose of unit tests, it's better to create a user object with a UID and a name. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Do not require replies from mocked sdap_get_generic_recv to be talloc ↵Jakub Hrozek2014-07-011-2/+1
| | | | | | | | | | contexts While it's beneficial for the real implementation of sdap_get_generic_recv() to move memory around, the mocked implementation can just pass around pointer. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Fix group search baseJakub Hrozek2014-07-011-1/+1
| | | | | | | After fixing the confdb initialization I realized the group DN couldn't be parsed. This patch fixes that. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Use the right confdb pathJakub Hrozek2014-07-011-1/+1
| | | | | | | The nested group test only worked by accident. Its confdb settings were not applied because a wrong confdb path was used. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TESTS: Add confdb domain base DN to sss_test_ctxJakub Hrozek2014-07-014-9/+11
| | | | | | | | Creation of the path to the domain's confdb entry was duplicated in the tests. Rather than adding yet another duplication, I added the path as another field of the sss_test_ctx structure. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* Use DISCARD_ALIGN in VTABLE_FUNC macroMichal Zidek2014-07-011-1/+1
| | | | | | fixes: https://fedorahosted.org/sssd/ticket/1359 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* Suppress safealign warnings with DISCARD_ALIGN.Michal Zidek2014-07-013-4/+8
| | | | | | | | These warnings were all false positives. fixes: https://fedorahosted.org/sssd/ticket/1359 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* Add type parameter to DISCARD_ALIGN macroMichal Zidek2014-07-012-2/+2
| | | | | | | | | This macro will be used to suppress alignment warnings when casting pointers. fixes: https://fedorahosted.org/sssd/ticket/1359 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* AD-GPO: Add support for gpo permissive modeYassir Elley2014-07-013-6/+32
| | | | Reviewed-by: Sumit Bose <sbose@redhat.com>
* Use ldap_url_parse to extract hostname from ldap uriYassir Elley2014-07-011-5/+20
| | | | Reviewed-by: Sumit Bose <sbose@redhat.com>
* AD-GPO: Add gpo-smb implementation in gpo_child processYassir Elley2014-07-015-12/+1546
| | | | Reviewed-by: Sumit Bose <sbose@redhat.com>
* LDAP: Fix retrieving a group with no membersJakub Hrozek2014-06-271-2/+7
| | | | | | | | | | | | | | sysdb_attrs_get_el() cannot return ENOENT. Even if the requested member doesn't exist, an empty element is created instead. This patch changes the code to use sysdb_attrs_get_el_ext() which returns ENOENT. The code only ever worked because we forgot to check the return value of sdap_nested_group_split_members(). When the empty attribute reached sdap_nested_group_split_members(), the function returned ENOMEM and count == 0. The caller used to only check the value of count, not the retval. Reviewed-by: Pavel Reichl <preichl@redhat.com>
* LDAP: group_split_members returns incorrectly ENOMEMPavel Reichl2014-06-271-1/+4
| | | | | | | | | Don't fail if num_missing is 0. Resolves: https://fedorahosted.org/sssd/ticket/2369 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SDAP: return after tevent_req_errorPavel Reichl2014-06-271-1/+2
| | | | | | Don't call tevent_req_done after tevent_req_error (for the same request). Reviewed-by: Sumit Bose <sbose@redhat.com>
* sudo: return after tevent_req_errorPavel Reichl2014-06-271-0/+1
| | | | | | Don't call tevent_req_done after tevent_req_error (for the same request). Reviewed-by: Sumit Bose <sbose@redhat.com>
* NSS: lookup_netgr_step don't access result on ENOENTPavel Reichl2014-06-251-13/+11
| | | | | | | Don't access result if return value is not EOK. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: sysdb_getnetgr - return ENOENTPavel Reichl2014-06-251-0/+6
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SYSDB: sysdb_getnetgr returns ENOENTPavel Reichl2014-06-251-13/+9
| | | | | | | | | | | Replace call of ldb_search by sss_ldb_search to make sure that ENOENT is returned if no results were found. Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: add tests for sss_ldb_searchPavel Reichl2014-06-251-0/+97
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SYSDB: sss_ldb_search - wrapper around ldb_searchPavel Reichl2014-06-252-0/+56
| | | | | | | | | | | Make sure that if no results were found ENOENT is returned rather than just empty list of results. Resolves: https://fedorahosted.org/sssd/ticket/1991 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* nested groups: do not fail if we get one entry twicePavel Březina2014-06-231-4/+6
| | | | | | https://fedorahosted.org/sssd/ticket/2341 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* build: Allow augmenting TESTS_ENVIRONMENTNikolai Kondrashov2014-06-231-1/+2
| | | | | | | | | | | | | | Add substitution of a special variable "AUX_TESTS_ENVIRONMENT" to the "TESTS_ENVIRONMENT" value, allowing its augmentation from the make command line. This enables wrapping test commands with older versions of Automake, where LOG_COMPILER support is missing. This enables executing "make check" target with Valgrind on RHEL6, like this: make check AUX_TESTS_ENVIRONMENT="libtool --mode=execute valgrind" Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: Fix format string in check macrosLukas Slebodnik2014-06-233-3/+3
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* SYSDB: Modify declaration of sysdb_search_entryLukas Slebodnik2014-06-232-2/+2
| | | | | | | | | | Type of parameter scope was changed s/int/enum ldb_scope/ This patch fixes warning from static analysers: src/db/sysdb_ops.c:228: mixed_enum_type: enumerated type mixed with another type Reviewed-by: Pavel Reichl <preichl@redhat.com>
* SYSDB: Remove useless NULL test.Lukas Slebodnik2014-06-231-1/+1
| | | | | | | There is a test for NULL after calling talloc_strndup and variable version was used a few times in strcmp before debug message. Reviewed-by: Pavel Reichl <preichl@redhat.com>
* CONFIGURE: Prefer python2Lukas Slebodnik2014-06-202-1/+2
| | | | | | | | | | | | | | | | | | | | | | | The configure script failed with python3 checking for python... /usr/bin/python checking for python version... 3.3 checking for python platform... linux checking for python script directory... ${prefix}/lib/python3.3/site-packages checking for python extension module directory... ${exec_prefix}/lib64/python3.3/site-packages checking for headers required to compile python extensions... File "<string>", line 1 import sys; print sys.prefix ^ SyntaxError: invalid syntax File "<string>", line 1 import sys; print sys.exec_prefix ^ SyntaxError: invalid syntax not found configure: error: Could not find python headers Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Pavel Reichl <preichl@redhat.com>
* sysdb: add sysdb_search_user_by_upn() with testsSumit Bose2014-06-203-0/+298
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sysdb: make canonicalUserPrincipalName case-insensitiveSumit Bose2014-06-203-1/+67
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SYSDB: sysdb_search_custom fix memory leakPavel Reichl2014-06-201-5/+17
| | | | | | Add temporally talloc context to allocate basedn on. Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* SYSDB: sysdb_search_entry fix memory leakPavel Reichl2014-06-202-11/+22
| | | | | | | Allocate res on tmp_ctx instead of on mem_ctx. Also use '_' prefix convention for output parameters. Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* TESTS: sysdb_search_return_ENOENT - check mem leaksPavel Reichl2014-06-201-0/+2
| | | | Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>