summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* IDMAP: Add minor performance improvementsPavel Reichl2016-03-011-11/+84
| | | | | | | | Some ID ranges are precalculated when ID mapping is being initialized. This patch utilizes these (helper) ranges when new domains are generated if appropriate. Reviewed-by: Sumit Bose <sbose@redhat.com>
* CI: Use yum-deprecated instead of dnfLukas Slebodnik2016-03-012-4/+17
| | | | | | | | | /usr/bin/yum is provided by the dnf-yum package and call /usr/bin/dnf on new fedora distributions. We should directly use old style yum which was renamed to /usr/bin/yum-deprecated and is still part of the yum package. Reviewed-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
* GPO: Add other display managers to interactive logonStephen Gallagher2016-02-292-1/+26
| | | | | | | | Gone are the days when all systems used GDM or KDM. We need to support other display managers in the default configuration to avoid issues when enrolled in AD domains. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* GPO: Add Cockpit to the Remote Interactive defaultsStephen Gallagher2016-02-292-1/+8
| | | | | | | | | The Cockpit Project is an administrative console that is gaining in popularity and is a default component on some operating systems (such as Fedora Server). Since it is becoming more common, we should ensure that it is part of the standard mapping. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* IPA: invalidate override data if original view is missingSumit Bose2016-02-261-3/+13
| | | | | | | | | | | | | | If the idview name cannot be read from cache this either means that the cache was empty or the name wasn't written because of an error. In the case of an error SSSD would assume that the default view was used. If the new view is different from the default view the override data must be invalidated. Since the sysdb call to invalidate the override data would work with an empty cache as well and do nothing it is safe to call it on both cases. Related to https://fedorahosted.org/sssd/ticket/2960 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA: lookup idview name even if there is no master domain recordSumit Bose2016-02-261-35/+43
| | | | | | | | | | | | | | | Currently the IPA subdomain provider returns with a error if there is no master domain record found. Since this record contains data which is only needed to create a trust with AD, like e.g. the IPA domain SID, this record is only created by ipa-adtrust-install. But the idview name is read after the master domain record. To make the idview feature work with a plain FreeIPA setup without running ipa-adtrust-install the missing master domain record should be handled gracefully and the following lookup should run as well. Resolves https://fedorahosted.org/sssd/ticket/2960 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: Extend test_child_common.c to include tests for the only_extra_args ↵Jakub Hrozek2016-02-262-7/+91
| | | | | | | functionality Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: Use the common if-else coding styleJakub Hrozek2016-02-251-4/+2
| | | | | Reviewed-by: Petr Cech <pcech@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* build: detect endianness at configure timeDavid Disseldorp2016-02-241-0/+3
| | | | | | | | | WORDS_BIGENDIAN, HAVE_BIG_ENDIAN and HAVE_LITTLE_ENDIAN are needed by Samba. See Samba's byteorder.h header for an example. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* LDAP: Use the IPA provider interface to resolve external group membersJakub Hrozek2016-02-244-29/+657
| | | | | | | | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2522 Currently the approach is not optimized for performance, because each external member is resolved in a full transaction to make sure even ID views and similar information is processed. In future, we should implement https://fedorahosted.org/sssd/ticket/2943 we will again be able to process all the data in a single transaction. Reviewed-by: Sumit Bose <sbose@redhat.com>
* IPA: Add interface to call into IPA provider from LDAP providerJakub Hrozek2016-02-246-1/+342
| | | | | | | | | | | https://fedorahosted.org/sssd/ticket/2522 Adds a pluggable interface that is able to resolve the IPA group's external members. At the moment, the request calls the full be_ interface to make sure all corner cases like id-views are handled internally. Reviewed-by: Sumit Bose <sbose@redhat.com>
* Add a new option ldap_group_external_memberJakub Hrozek2016-02-2410-0/+27
| | | | | | | Required for: https://fedorahosted.org/sssd/ticket/2522 Reviewed-by: Sumit Bose <sbose@redhat.com>
* TEST_TOOLS_COLONDB: Add tests for sss_colondb_*Petr Cech2016-02-242-0/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three functions at API of colondb wrapper: * sss_colondb_open() * sss_colondb_readline() * sss_colondb_writeline() This patch adds tests for all of them. We test those cases: * open nonexisting file for read * open nonexisting file for write * open existing empty file for read * open existing file with records for read * open existing empty file for write * open existing file with records for write * write to empty file * write to file with existing records * sss_colondb_open() * sss_colondb_readline() * sss_colondb_write_line() * write to empty file and read it Resolves: https://fedorahosted.org/sssd/ticket/2764 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TOOLS: Add comments on functions in colondbPetr Cech2016-02-241-0/+23
| | | | | | | | | | | | | | | | | | The colondb API provides three function: * sss_colondb_open() * sss_colondb_write_field() * sss_colondb_read_field() It is not obvious that sss_colondb_open() add destructor on talloc context which close the colondb during free context. And there is expectation that SSS_COLONDB_SENTINEL is type of last item in line. So this patch adds simple lightening comments in doxygen style. Resolves: https://fedorahosted.org/sssd/ticket/2764 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TOOLS: Fix memory leak after getline() failedPetr Cech2016-02-241-0/+4
| | | | | | | | | | | | | | | | | | This patch fixes buffer freeing in case if getline() failed in function sss_colondb_readline(). ssize_t getline(char **lineptr, size_t *n, FILE *stream); If *lineptr is set to NULL and *n is set 0 before the call, then getline() will allocate a buffer for storing the line. This buffer should be freed by the user program even if getline() failed. man 3 getline This patch fix buffer freeing in case if getline() failed. Resolves: https://fedorahosted.org/sssd/ticket/2764 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* TOOLS: Fix minor memory leak in sss_colondb_writelineLukas Slebodnik2016-02-241-0/+7
| | | | | | | | | | The variable line was initialized to NULL. The we created temporary context tmp_ctx. We use talloc_asprintf_append to append string to line which is initially NULL and therefore new context which was not connected to tmp_ctx. man 3 talloc_string -> talloc_asprintf_append Reviewed-by: Petr Cech <pcech@redhat.com>
* DEBUG: Ignore ENOENT for change owner of log filesLukas Slebodnik2016-02-231-0/+7
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2493 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Revert "DEBUG: Preventing chown_debug_file if journald on"Lukas Slebodnik2016-02-231-19/+16
| | | | | | | | | | | | | | | | This reverts commit 6e2822b151c21ce6e3287a0cf25d40e9f10a6127. The function chown_debug_file is called before initialization of debug stuff in sssd. Therefore variable debug_file cannot be initialized. Therefore reverted commit completely turned off changing owner of debug files. Side effect of this change was that annoying error messages was not logged in case of journald. Resolves: https://fedorahosted.org/sssd/ticket/2938 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* subdomains: inherit ldap_krb5_keytabSumit Bose2016-02-232-0/+5
| | | | | | | | | | If a non-default keytab is configured for the parent domain the subdomains will still use the default keytab because the alternative keytab is not inherited. As a consequence SSSD might not be able to connect to services in the subdomain because the default keytab is either not present or does not have suitable keys. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* UTIL: Use sss_vdebug_fn for callbacksLukas Slebodnik2016-02-232-22/+5
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* HBAC: Check format string in hbac log functionLukas Slebodnik2016-02-232-1/+9
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: log real hbac functionLukas Slebodnik2016-02-233-2/+5
| | | | | | | The string "hbac" wsa logged previously. Real hbac function will be logged with this patch. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: Use sss_vdebug_fn in hbac_debug_messagesLukas Slebodnik2016-02-231-12/+1
| | | | | | | This patch reduce unnecessary memory allocations for log messages from libhbac. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* UTIL: Provide varargs version of debug_fnLukas Slebodnik2016-02-232-10/+25
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* UTIL: Use prefix for debug functionLukas Slebodnik2016-02-234-17/+17
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* Fix typos reported by lintianLukas Slebodnik2016-02-239-15/+15
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* krb5_child: Warn if user cannot read krb5.confLukas Slebodnik2016-02-191-0/+24
| | | | | | | | | | | | | | | | | | Attached patch should siplify troubleshoting of issues with permission of krb5.conf. It's not clear from krb5_child.log even with full debug level. [sss_get_ccache_name_for_principal] (0x4000): Location: [FILE:/tmp/krb5cc_12069_XXXXXX] [sss_get_ccache_name_for_principal] (0x2000): krb5_cc_cache_match failed: [-1765328243] [Can't find client principal user@EXAMPLE.COM in cache collection] [create_ccache] (0x0020): 735: [13][Permission denied] Resolves: https://fedorahosted.org/sssd/ticket/2931 Reviewed-by: Michal Židek <mzidek@redhat.com>
* sss_idmap-tests: Fix segmentation faultLukas Slebodnik2016-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | I can reproduce it only with clang. But it's tipical off by one error. sh$ ./sss_idmap-tests Running suite(s): IDMAP Segmentation fault (core dumped) Running suite(s): IDMAP ==2644== Process terminating with default action of signal 11 (SIGSEGV) ==2644== Access not within mapped region at address 0xA08F430 ==2644== at 0x4C2CC53: strcmp (vg_replace_strmem.c:842) ==2644== by 0x4060DA: idmap_test_sid2uid_additional_secondary_slices (sss_idmap-tests.c:451) ==2644== by 0x503C78A: ??? (in /usr/lib64/libcheck.so.0.0.0) ==2644== by 0x503CB7C: srunner_run (in /usr/lib64/libcheck.so.0.0.0) ==2644== by 0x4061EE: main (sss_idmap-tests.c:965) ==2644== If you believe this happened as a result of a stack ==2644== overflow in your program's main thread (unlikely but ==2644== possible), you can try to increase the size of the ==2644== main thread stack using the --main-stacksize= flag. ==2644== The main thread stack size used in this run was 8388608. Reviewed-by: Sumit Bose <sbose@redhat.com>
* PAM: Fix man for pam_account_{expired,locked}_messageDan Lavu2016-02-171-6/+29
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* PAM: Pass account lockout status and display messagePavel Reichl2016-02-176-8/+66
| | | | | | | | | Tested against Windows Server 2012. Resolves: https://fedorahosted.org/sssd/ticket/2839 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SDAP: Add return code ERR_ACCOUNT_LOCKEDPavel Reichl2016-02-173-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add code to distinquish state when account is locked in Active Directory server. Tested against Windows Server 2012 This patch is best effort only as decision whether account is actually locked is based on parsing error message returned by AD. The format and content of this error message might be subject of change in future releases and also can be modified by AD administrators. If account is locked bind operation is expected to return following error message: ----------------------------------------------------------------------- Invalid credentials(49), 80090308: LdapErr: DSID-0C0903C5, comment: AcceptSecurityContext error, data 775, v23f0 ----------------------------------------------------------------------- Where sub string 'data 775' implies that account is locked (ERROR_ACCOUNT_LOCKED_OUT) [1]. However the 80090308 (error code 0x80090308, SEC_E_INVALID_TOKEN) is the only guaranteed part of error string [2]. Error message is described in further detail as [3]: ----------------------------------------------------------------------- When the server fails an LDAP operation with an error, and the server has sufficient resources to compute a string value for the errorMessage field of the LDAPResult, it includes a string in the errorMessage field of the LDAPResult (see [RFC2251] section 4.1.10). The string contains further information about the error. The first eight characters of the errorMessage string are a 32-bit integer, expressed in hexadecimal. Where protocol specifies the extended error code "<unrestricted>" there is no restriction on the value of the 32-bit integer. It is recommended that implementations use a Windows error code for the 32-bit integer in this case in order to improve usability of the directory for clients. Where protocol specifies an extended error code which is a Windows error code, the 32-bit integer is the specified Windows error code. Any data after the eighth character is strictly informational and used only for debugging. Conformant implementations need not put any value beyond the eighth character of the errorMessage field. ----------------------------------------------------------------------- [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms681386%28v=vs.85%29.aspx [2] https://social.msdn.microsoft.com/Forums/en-US/e1d600c8-60b7-4ed0-94cb-20ddd6c1a1c6/msadts-user-locking-password-policies?forum=os_windowsprotocols [3] MS-ADTS 3.1.1.3.1.9 https://msdn.microsoft.com/en-us/library/cc223253.aspx Resolves: https://fedorahosted.org/sssd/ticket/2839 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* SPEC: Remove unnecessary requirementsLukas Slebodnik2016-02-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | We do not need to requires specific version of libldb or libtdb because it is automatically detected from binary/library dependencies. We also need never version of that libraries as it was specified in spec file. e.g. sh$ rpm -q --requires sssd-common | grep -E "TDB|LDB" libldb.so.1(LDB_0.9.10)(64bit) libtdb.so.1(TDB_1.2.1)(64bit) There is also redundant dependency on sssd-common-pac sssd -> sssd-ipa -> sssd-common-pac -> sssd-ad -> sssd-common-pac -> sssd-common-pac sh$ rpm -q --whatrequires sssd-common-pac sssd-ipa-1.13.3-1.fc23.x86_64 sssd-ad-1.13.3-1.fc23.x86_64 sssd-1.13.3-1.fc23.x86_64 Reviewed-by: Sumit Bose <sbose@redhat.com>
* IDMAP: Add test to validate off by one bugPavel Reichl2016-02-151-4/+109
| | | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2922 Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Michal Židek <mzidek@redhat.com>
* Just return NULL if tevent_req_create() failsSumit Bose2016-02-115-10/+5
| | | | | | | | | In general we just return NULL if tevent_req_create() fails because there is nothing we can do with the request anyway. Especially tevent_req_error() should not be called because it tries to dereference req. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* SPEC: Move libsss_autofs.so outside sssd-commonLukas Slebodnik2016-02-101-4/+15
| | | | | | | | It will reduce dependency chain in container world. libsss_autofs.so depends only on libc and requires sssd unix sockets. And sssd-common has many requirements. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SDAP: Add error code to debug messagePavel Reichl2016-02-091-2/+4
| | | | Reviewed-by: Michal Židek <mzidek@redhat.com>
* intg: Change preference of openldap module pathLukas Slebodnik2016-02-091-2/+2
| | | | | | | | | | | The /usr/lib64 should be preffered path for searching binary modules for openldap backends. The /usr/lib/ should be used for storing no binary files on 64 bit platform e.g. scripts ... The current vresion of would choose /usr/lib/ even though /usr/lib64 contains real openldap modules. Reviewed-by: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
* NSS: Fix memory leak netgroupPavel Reichl2016-02-041-12/+29
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2865 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IDMAP: Man change for ldap_idmap_range_size optionPavel Reichl2016-02-031-1/+3
| | | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2922 Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com> Reviewed-by: Michal Židek <mzidek@redhat.com>
* PYTHON: Fix pep8 errors in sss_obfuscateLukas Slebodnik2016-02-031-5/+8
| | | | | | | | | | | | src/tools/sss_obfuscate:12:1: E302 expected 2 blank lines, found 1 src/tools/sss_obfuscate:29:80: E501 line too long (111 > 79 characters) src/tools/sss_obfuscate:35:1: E302 expected 2 blank lines, found 1 src/tools/sss_obfuscate:47:80: E501 line too long (107 > 79 characters) src/tools/sss_obfuscate:50:13: E265 block comment should start with '# ' src/tools/sss_obfuscate:58:17: E265 block comment should start with '# ' src/tools/sss_obfuscate:107:5: E303 too many blank lines (2) Reviewed-by: Martin Basti <mbasti@redhat.com>
* PYTHON: sss_obfuscate should work with python3Lukas Slebodnik2016-02-031-11/+13
| | | | | | | | | Based on patch from: Steven W. Elling <ellingsw+29044@gmail.com> Resolves: https://fedorahosted.org/sssd/ticket/2937 Reviewed-by: Martin Basti <mbasti@redhat.com>
* server-tests: Fix clean-up after successful testLukas Slebodnik2016-02-021-1/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TESTS: Fix race condition in python testLukas Slebodnik2016-02-022-34/+32
| | | | | | | | | | Python tests for pyhbac and pysss_murmur created symbolic links in shared directory ".libs". It happened that both tests created symbolic link in the same time and therefore python2 test could try to import link to python3 module which caused failures in tests. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* CONFIGURE: Replace obsoleted macro AC_PROG_LIBTOOLLukas Slebodnik2016-02-021-1/+1
| | | | | | The AC_PROG_LIBTOOL macro is obsoleted since libtool 2.0 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* SPEC: Move polkit rules into sssd-polkit-rules subpackageAlexander Bokovoy2016-02-021-6/+18
| | | | | | | | | | | | | We recently added /usr/share/polkit-1/rules.d to the spec file to fix issues with unowned directories. However there is conflict with polkit package. The owner is not root. Running transaction test Error: Transaction check error: file /usr/share/polkit-1/rules.d from install of sssd-common-1.13.90-0.20160125.1503.git1b8858b.master.f +c23.x86_64 conflicts with file from package polkit-0.113-4.fc23.x86_64 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* SPEC: Fix packaging of libsss_simpleifpLukas Slebodnik2016-02-021-1/+4
| | | | | | | | | | | | | | | | Patch removes unnecessary requires of dbus-libs because it's already detected from library. However we forgot to call ldconfig after (un)installation. sh$ rpm -q -p --requires libsss_simpleifp-1.13.90-0.fc23.x86_64.rpm | grep dbus libdbus-1.so.3()(64bit) libdbus-1.so.3(LIBDBUS_1_3)(64bit) sssd-dbus = 1.13.90-0.fc23 sh$ rpm -q --whatprovides "libdbus-1.so.3()(64bit)" dbus-libs-1.10.6-1.fc23.x86_64 Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com>
* SPEC: Remove unnecessary clean-up of buildrootLukas Slebodnik2016-02-021-4/+0
| | | | | | | | | | rhel5 required to clean buildroot in install section. The %clean section is not required for F-13 and above, and EPEL 6 and above. EPEL 5 MUST have a %clean section that cleans the buildroot: https://fedoraproject.org/wiki/EPEL:Packaging#Prepping_BuildRoot_For_.25install Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com>
* pyhbac: Fix warning Wsign-compareLukas Slebodnik2016-01-291-7/+11
| | | | | | | | | | | | | | | | | | | | src/python/pyhbac.c: In function ‘HbacRuleElement_repr’: src/python/pyhbac.c:506:59: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (strnames == NULL || strgroups == NULL || category == -1) { ^ src/python/pyhbac.c: In function ‘HbacRuleElement_to_native’: src/python/pyhbac.c:614:51: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] if (!el->names || !el->groups || el->category == -1) { ^ The static function native_category had type of terurn value uint32_t But it also could return -1 which indicated an error. It's better to don't mix return code with returned value. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* pysss_murmur: Fix warning Wsign-compareLukas Slebodnik2016-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | src/python/pysss_murmur.c: In function ‘py_murmurhash3’: src/python/pysss_murmur.c:47:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] key_len > strlen(key)) { ^ uint32_t murmurhash3(const char *key, int len, uint32_t seed) The second argument of the function murmurhash3 has type int. But the code expects to be unsigned integer. There is code in python wrapper py_murmurhash3 which check boundaries of that argument. It should be an unsigned "key_len > INT_MAX || key_len < 0". An exception should be thrown for negative number. Moreover, the length should be shorter then a length of input string. The strlen returns size_t which is unsigned and key_len is signed long. We already checked that value is unsigned so we can safely cast key_len to size_t Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* TOOLS: Fix warning Wsign-compareLukas Slebodnik2016-01-291-1/+1
| | | | | | | | | | src/tools/tools_util.c: In function ‘parse_groups’: src/tools/tools_util.c:116:19: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] for (i = 0; i < tokens; i++) { ^ Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>