History log of /sssd-io/src/tests/util-tests.c
Revision Date Author Comments Expand
49dd8ee2834d9477418961dbaffa4a03cfa9fd1e 29-Jan-2018 René Genz <liebundartig@freenet.de>

Fix minor spelling mistakes in tests/* Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

3996e391054a1c02ab62e1541ae21a8204bd5d0a 03-Aug-2017 AmitKumar <amitkuma@redhat.com>

Moving headers used by both server and client to special folder These are the header files which are used by both client and server: src/util/io.h src/util/murmurhash3.h src/util/util_safealign.h This patch is about moving these header files to special folder (src/shared). It will be easier to identify these headers when looking for them in the src tree. util_safalign.h is renamed as safalign.h because util_ namespace is appropriate when this file belonged to the util's folder which is no longer the case. Resolves: https://pagure.io/SSSD/sssd/issue/1898 Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>

91141c6ae6e6a255cfd66266581671ddd16086b3 08-Jun-2017 Lukas Slebodnik <lslebodn@redhat.com>

UTIL: Remove signal.h from util/util.h signal.h is not used directly by util/util.h. The header file signal.h must be included in 19 files and after removing it from util.h it had to be added only to 12 missing files. And util.util.h is included in 381 files Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>

db37eca433a5530975422b985b024a0e6ddbdc17 10-Mar-2017 Lukas Slebodnik <lslebodn@redhat.com>

util-test: Extend unit test for sss_filter_sanitize_ex Related-to: https://pagure.io/SSSD/sssd/issue/3317 Reviewed-by: Pavel Březina <pbrezina@redhat.com>

4230e6faa907b693ccf66b3a29f9be57b87aab14 14-Oct-2015 Petr Cech <pcech@redhat.com>

UTIL-TESTS: More restrictive permissions This test suite tries to write into and to read from temp. files. There is no reason to have executable permission. So this patch replaces SSS_DFL_X_UMASK with SSS_DFL_UMASK. Resolves: https://fedorahosted.org/sssd/ticket/2424 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

f8e337540d280f944098cd4dd7d670e2f7166b54 14-Oct-2015 Petr Cech <pcech@redhat.com>

REFACTOR: umask(077) --> umask(SSS_DFL_X_UMASK) There are many calls of umask function with 077 argument. This patch add new constant SSS_DFL_X_UMASK which stands fot 077. So all occurences of umask(077) are replaced by constant SSS_DFL_X_UMASK. Resolves: https://fedorahosted.org/sssd/ticket/2424 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

fa7921c8259539b750f7e9e7bcd82aa72020826a 15-Jul-2015 Jakub Hrozek <jhrozek@redhat.com>

UTIL: Add sss_filter_sanitize_ex Related: https://fedorahosted.org/sssd/ticket/2553 In order to support wildcard request, we need to introduce an optionally relaxed version of sss_filter_sanitize that allows to select which characters are exempt from sanitizing. Reviewed-by: Pavel Březina <pbrezina@redhat.com>

7a4e3e29196e3abc1746714fcf93624edae89f93 01-Jun-2015 Lukas Slebodnik <lslebodn@redhat.com>

util-tests: Add validation of internal error messages The function sss_strerror() should not return a sentence. It shoudl return string; the same as strerror() Reviewed-by: Pavel Březina <pbrezina@redhat.com>

e11b9f85b5ad0454cdf3828c4876ec7de3f4799a 08-Apr-2015 Jakub Hrozek <jhrozek@redhat.com>

tests: Revert strcmp condition Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

2f84032c28ac414b77a5c1ad470eb69ed6c6a1b4 08-Apr-2015 Lukas Slebodnik <lslebodn@redhat.com>

util-tests: Initialize boolean variable to default value The boolean variable found_nss could be used uninitialized in test test_known_service if service "nss" would not be found. We would catch it with valgind. Reviewed-by: Pavel Reichl <preichl@redhat.com>

7650ded4ffa87fcf7ce5adf00920fecf89cffcf5 13-Mar-2015 Michal Zidek <mzidek@redhat.com>

test: Check ERR_LAST Check if number of error codes and messages is the same. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>

5a5c5cdeb92f4012fc75fd717bfea06598f68f12 05-Mar-2015 Pavel Reichl <preichl@redhat.com>

UTIL: convert GeneralizedTime to unix time New utility function *sss_utc_to_time_t* to convert GeneralizedTime to unix time. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>

f3d91181d4ee9da3f8bbf4ddf8782951c0ae46c1 15-Jan-2015 Jakub Hrozek <jhrozek@redhat.com>

UTIL: Unify the fd_nonblocking implementation The responder and child_common modules each had their own implementation. Unify it instead and add a unit test. Reviewed-by: Pavel Březina <pbrezina@redhat.com>

6b57784f0f175275fd900eca21c77415e3a5ea52 09-Jul-2014 Jakub Hrozek <jhrozek@redhat.com>

TOOLS: Always debug to stderr https://fedorahosted.org/sssd/ticket/2348 Programs that are supposed to only be executed on the foreground should log to stderr automatically. Reviewed-by: Michal Židek <mzidek@redhat.com>

auth-tests.c cmocka/sbus_internal_tests.c cmocka/test_ad_access_filter.c cmocka/test_ad_common.c cmocka/test_ad_gpo.c cmocka/test_dp_opts.c cmocka/test_dyndns.c cmocka/test_fqnames.c cmocka/test_ifp.c cmocka/test_ipa_idmap.c cmocka/test_nested_groups.c cmocka/test_nss_srv.c cmocka/test_responder_common.c cmocka/test_sdap.c cmocka/test_sss_idmap.c cmocka/test_sss_sifp.c cmocka/test_utils.c crypto-tests.c fail_over-tests.c files-tests.c krb5_child-test.c krb5_utils-tests.c refcount-tests.c resolv-tests.c responder_socket_access-tests.c simple_access-tests.c strtonum-tests.c sysdb-tests.c sysdb_ssh-tests.c util-tests.c /sssd-io/src/tools/sss_cache.c /sssd-io/src/tools/sss_debuglevel.c /sssd-io/src/tools/sss_groupadd.c /sssd-io/src/tools/sss_groupdel.c /sssd-io/src/tools/sss_groupmod.c /sssd-io/src/tools/sss_groupshow.c /sssd-io/src/tools/sss_seed.c /sssd-io/src/tools/sss_useradd.c /sssd-io/src/tools/sss_userdel.c /sssd-io/src/tools/sss_usermod.c /sssd-io/src/util/util.h
852722ecb5dc09fc80cd3c837edb1cf6db529210 08-Jul-2014 Lukas Slebodnik <lslebodn@redhat.com>

UTIL: Fix access out of bound in parse_args 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>

5246ab9134aa2c8b977b3b1f7b0929cfbbaf951f 28-May-2014 Jakub Hrozek <jhrozek@redhat.com>

tests: Add test for get_known_services Reviewed-by: Pavel Březina <pbrezina@redhat.com>

2aa96da5f3a9485d598e345e183a59a4b8e80abb 26-Feb-2014 Lukas Slebodnik <lslebodn@redhat.com>

TEST: Fix warning invalid printf argument type Reported by: cppcheck "%d" in format string (no. 1) requires 'int' but the argument type is 'unsigned int' Reviewed-by: Michal Žídek <mzidek@redhat.com>

2e57e339798f47ad84cae9121559d19192b79146 17-Oct-2013 Michal Zidek <mzidek@redhat.com>

util: Add functions to check if IP addresses is special Added functions to check if given IP address is a special address (broadcast, multicast...).

abac0f3ec2baa597d8e21a8744de6f33506299ce 05-Sep-2013 Pavel Březina <pbrezina@redhat.com>

utils: add is_host_in_domain()

58dee4047788964ed4b0f6c5d6512967f390ac21 03-Sep-2013 Lukas Slebodnik <lslebodn@redhat.com>

UTIL: Use standard maximum value of type size_t It is better to use standard constant for maximum value of type size_t, instead of reinventing wheel with own defined constant SIZE_T_MAX This patch replace string "SIZE_T_MAX" -> "SIZE_MAX"

4139a7a731f2831963a42b26aac111422be28792 17-Apr-2013 Jakub Hrozek <jhrozek@redhat.com>

Make leak checks usable in tests that do not utilize check * Remove check-specific failure reporting from common_check.c * Check-specific abstraction over memleak checks * Rename common_check.c to leak_check.c

04759b59e71c78ab23b84d13dd29d9c6dd680adb 02-Jan-2013 Michal Zidek <mzidek@redhat.com>

failover: Protect against empty host names Added new parameter to split_on_separator that allows to skip empty values. The whole function was rewritten. Unit test case was added to check the new implementation. https://fedorahosted.org/sssd/ticket/1484

032d0980dfe5a27a5954f44f9d519e03fc7d1ced 14-Nov-2012 Sumit Bose <sbose@redhat.com>

Add string_in_list() and add_string_to_list() with tests string_in_list() and add_string_to_list() are two utilities for NULL terminated strings arrays. add_string_to_list() adds a new string to an existing list or creates a new one with the strings as only item if there is not list. string_in_list() checks if a given string is in the list. It can be used case sensitive or in-sensitive.

9e2c64c6d4f5560e27207193efea6536a566865e 29-Oct-2012 Michal Zidek <mzidek@redhat.com>

Include talloc log in our debug facility https://fedorahosted.org/sssd/ticket/1495

/sssd-io/src/monitor/monitor.c /sssd-io/src/providers/data_provider_be.c /sssd-io/src/providers/krb5/krb5_child.c /sssd-io/src/providers/ldap/ldap_child.c /sssd-io/src/providers/proxy/proxy_child.c /sssd-io/src/responder/autofs/autofssrv.c /sssd-io/src/responder/nss/nsssrv.c /sssd-io/src/responder/pac/pacsrv.c /sssd-io/src/responder/pam/pamsrv.c /sssd-io/src/responder/ssh/sshsrv.c /sssd-io/src/responder/sudo/sudosrv.c /sssd-io/src/sss_client/ssh/sss_ssh_authorizedkeys.c /sssd-io/src/sss_client/ssh/sss_ssh_knownhostsproxy.c auth-tests.c crypto-tests.c fail_over-tests.c files-tests.c krb5_child-test.c krb5_utils-tests.c refcount-tests.c resolv-tests.c responder_socket_access-tests.c simple_access-tests.c strtonum-tests.c sysdb-tests.c sysdb_ssh-tests.c util-tests.c /sssd-io/src/tools/sss_cache.c /sssd-io/src/tools/sss_debuglevel.c /sssd-io/src/tools/sss_groupadd.c /sssd-io/src/tools/sss_groupdel.c /sssd-io/src/tools/sss_groupmod.c /sssd-io/src/tools/sss_groupshow.c /sssd-io/src/tools/sss_seed.c /sssd-io/src/tools/sss_useradd.c /sssd-io/src/tools/sss_userdel.c /sssd-io/src/tools/sss_usermod.c /sssd-io/src/util/debug.c /sssd-io/src/util/util.h
9959c512ac3ba36f7a0db7614f0357ce0bae748f 20-Apr-2012 Jakub Hrozek <jhrozek@redhat.com>

Move atomic io function to a separate module We'll be using it on various places of the SSSD. The function is in its own file to allow using just the one piece without having to drag in the whole util.c module.

e3c99ae355408933b03357220f3db09423bd40dd 20-Apr-2012 Jakub Hrozek <jhrozek@redhat.com>

sss_atomic_io: Do not fail reads with EPIPE if there is not enough data to read Also adds a unit test for sss_atomic_io()

8df169fdffb564ec932fede4216a123a71f1cc9a 09-Jan-2012 Simo Sorce <simo@redhat.com>

Add a random + identity test for murmurhash3 This test always generate a random string so each time the test is run we will test the hash function with a new value. It also hashes the same string twice and compares the result so that we have a chance of catching if uninitialized variables are getting mixed into the value calculation and end up generating different results for the same input.

5a70b84cb66fb8c7a3fce0e3f2e4b61e0b2ea9d4 09-Jan-2012 Simo Sorce <simo@redhat.com>

util: add murmurhash3 hash function

e5ea29f68a2fa08754c7685ef73dbf91ec9b581b 04-Jan-2012 Simo Sorce <simo@redhat.com>

tests: fix test group of utf8 tests

dbea04f585a30d001b574317c068cd03a4fa332b 16-Dec-2011 Jakub Hrozek <jhrozek@redhat.com>

sss_utf8_tolower utility function+unit tests

89caf5edcc99f5731e89bd51e6ffaad3ec11c304 25-Aug-2011 Pavel Březina <pbrezina@redhat.com>

New DEBUG facility - SSSDBG_UNRESOLVED changed from -1 to 0 Removed: SSS_UNRESOLVED_DEBUG_LEVEL (completely replaced with SSSDBG_UNRESOLVED) Added new macro: CONVERT_AND_SET_DEBUG_LEVEL(new_value) Changes unresolved debug level value (SSSDBG_UNRESOLVED) from -1 to 0 so DEBUG macro could be reduced by one condition. Anyway, it has a minor effect, every time you want to load debug_level from command line parameters, you have to use following pattern: /* Set debug level to invalid value so we can deside if -d 0 was used. */ debug_level = SSSDBG_INVALID; pc = poptGetContext(argv[0], argc, argv, long_options, 0); while((opt = poptGetNextOpt(pc)) != -1) { ... } CONVERT_AND_SET_DEBUG_LEVEL(debug_level);

/sssd-io/src/monitor/monitor.c /sssd-io/src/providers/data_provider_be.c /sssd-io/src/providers/krb5/krb5_child.c /sssd-io/src/providers/ldap/ldap_child.c /sssd-io/src/providers/proxy/proxy_child.c /sssd-io/src/responder/nss/nsssrv.c /sssd-io/src/responder/pam/pamsrv.c auth-tests.c crypto-tests.c debug-tests.c fail_over-tests.c files-tests.c krb5_utils-tests.c refcount-tests.c resolv-tests.c simple_access-tests.c strtonum-tests.c sysdb-tests.c util-tests.c /sssd-io/src/tools/sss_cache.c /sssd-io/src/tools/sss_groupadd.c /sssd-io/src/tools/sss_groupdel.c /sssd-io/src/tools/sss_groupmod.c /sssd-io/src/tools/sss_groupshow.c /sssd-io/src/tools/sss_useradd.c /sssd-io/src/tools/sss_userdel.c /sssd-io/src/tools/sss_usermod.c /sssd-io/src/util/debug.c /sssd-io/src/util/server.c /sssd-io/src/util/util.h
99dd40a885ed3d42af4bbbde7ee2fc98830544d0 25-Aug-2011 Pavel Březina <pbrezina@redhat.com>

New DEBUG facility - conversion https://fedorahosted.org/sssd/ticket/925 Conversion of the old debug_level format to the new one. (only where it was necessary) Removed: SSS_DEFAULT_DEBUG_LEVEL (completely replaced with SSSDBG_DEFAULT)

/sssd-io/src/monitor/monitor.c /sssd-io/src/monitor/monitor_sbus.c /sssd-io/src/providers/child_common.c /sssd-io/src/providers/data_provider.h /sssd-io/src/providers/data_provider_be.c /sssd-io/src/providers/data_provider_fo.c /sssd-io/src/providers/krb5/krb5_child.c /sssd-io/src/providers/ldap/ldap_child.c /sssd-io/src/providers/ldap/sdap_async.c /sssd-io/src/providers/ldap/sdap_fd_events.c /sssd-io/src/providers/proxy/proxy_auth.c /sssd-io/src/providers/proxy/proxy_child.c /sssd-io/src/providers/proxy/proxy_id.c /sssd-io/src/responder/nss/nsssrv.c /sssd-io/src/responder/pam/pamsrv.c /sssd-io/src/sbus/sssd_dbus_common.c auth-tests.c crypto-tests.c fail_over-tests.c files-tests.c find_uid-tests.c krb5_utils-tests.c refcount-tests.c resolv-tests.c simple_access-tests.c strtonum-tests.c sysdb-tests.c util-tests.c /sssd-io/src/tools/selinux.c /sssd-io/src/tools/sss_cache.c /sssd-io/src/tools/sss_groupadd.c /sssd-io/src/tools/sss_groupdel.c /sssd-io/src/tools/sss_groupmod.c /sssd-io/src/tools/sss_groupshow.c /sssd-io/src/tools/sss_useradd.c /sssd-io/src/tools/sss_userdel.c /sssd-io/src/tools/sss_usermod.c /sssd-io/src/util/debug.c /sssd-io/src/util/server.c /sssd-io/src/util/util.h
9873e54960fcbd65fd2f6c7d3404f8a1256ae759 15-Jun-2011 Jakub Hrozek <jhrozek@redhat.com>

Unit test for parge_args

f15683b4b100351e24e305d25bd4785c79ac8f55 11-Jan-2011 Sumit Bose <sbose@redhat.com>

Validate user supplied size of data items Specially crafted packages might lead to an integer overflow and the parsing of the input buffer might not continue as expected. This issue was identified by Sebastian Krahmer <krahmer@suse.de>.

ca92350db6ad6ac344181f7b8ec695eda29da675 15-Nov-2010 Stephen Gallagher <sgallagh@redhat.com>

Add utility function to sanitize LDAP/LDB filters Also adds a unit test.

daa53f46d3ddcba0cbe2d23251c250794e576cf1 13-Oct-2010 Sumit Bose <sbose@redhat.com>

Use POPT_TABLEEND to close option table

dbd09f5703d721a58210e490609cfacb7eb56fcf 03-Aug-2010 Stephen Gallagher <sgallagh@redhat.com>

Add diff_string_lists utility function Includes a unit test