summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* TEST: Fix warning invalid printf argument typeLukas Slebodnik2014-02-261-1/+1
| | | | | | | | | 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>
* NSS: Fix warning access array with index then checkLukas Slebodnik2014-02-261-3/+3
| | | | | | | | | | | | | | Reported by:cppcheck Defensive programming: The variable 'i' is used as an array index before it is checked that is within limits. This can mean that the array might be accessed out of bounds. This patch eorder condition such as '(a[i] && i <blen) to (i < blen && a[i]). That way the array will not be accessed if the index is out of limits. Reviewed-by: Michal Žídek <mzidek@redhat.com>
* KRB5: Fix condition for empty stringLukas Slebodnik2014-02-261-1/+1
| | | | | | | | | | | | Reported by: cppcheck Finding the same expression on both sides of an operator || is suspicious and might indicate a cut and paste or logic error. Resolves: https://fedorahosted.org/sssd/ticket/2258 Reviewed-by: Michal Žídek <mzidek@redhat.com>
* MAN: Clarify that changing ID mapping options might require purging the cacheJakub Hrozek2014-02-261-0/+42
| | | | | | | | | | | https://fedorahosted.org/sssd/ticket/2252 Currently SSSD chokes when IDs of users change, we don't support ID changes yet. Because some users were confused about the failures, this patch adds additional clarification. Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* MAN: Clarify the ldap_access_filter option furtherJakub Hrozek2014-02-261-4/+5
| | | | | | | | | | https://fedorahosted.org/sssd/ticket/2235 The memberof example was misleading and was making aministrators think that the ldap_access_filter can resolve nested group memberships. Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* DP: Provide separate dp_copy_defaults functionJakub Hrozek2014-02-265-22/+464
| | | | | | https://fedorahosted.org/sssd/ticket/2257 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* OPTS: Allow using defaults for blobsJakub Hrozek2014-02-261-0/+3
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: check ranges for collisions before saving themSumit Bose2014-02-261-20/+64
| | | | | | Fixes https://fedorahosted.org/sssd/ticket/2253 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA: refactor idmap code and add testSumit Bose2014-02-263-147/+357
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IDMAP: add sss_idmap_check_collision(_ex)Sumit Bose2014-02-263-37/+244
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* UTIL: Sanitize whitespaces.Lukas Slebodnik2014-02-261-0/+10
| | | | | | | | | | | | Original patches submitted by: mpesari(Thanks!!) It can cause problems if user will hit spaces before entering username. (e.g in gdm). Spaces are ignored by LDAP; it's better to escape them. Resolves: https://fedorahosted.org/sssd/ticket/1955 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* LDAP: Setup periodic task only once.Lukas Slebodnik2014-02-261-13/+41
| | | | | | | | | | | | | | If id provider is {ipa, ad} periodic task will be stared in sssm_{ipa,ad}_init If you enable enumeration and use different providers for id and sudo(autofs) then another periodic task will be scheduled. This can cause weird behaviour (e.g. missing members of group) Perodic tasks will be started only by id_provider. Resolves: https://fedorahosted.org/sssd/ticket/2153 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Fix DEBUG message formattingJakub Hrozek2014-02-252-2/+2
|
* sbus: Use constants to make dbus callsStef Walter2014-02-2415-65/+37
| | | | | | | | | | | This allows us to remove duplicated information, and have the compiler check that when an method name is changed or removed the callers are updated. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* sbus: Generate constants from interface definitionsStef Walter2014-02-245-0/+96
| | | | | | | | | | | | | | This is not strictly necessary, but avoids duplicating data in mulitple places, and makes the interface definitions benefit dbus callers (a little). After applying this commit you may need to 'make clean' as the codegen has changed. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* sbus: Rework sbus to use interface metadata and vtablesStef Walter2014-02-2420-159/+581
| | | | | | | | | | | | | | | | | | | | Previous commits added support for interface metadata and handler vtables. This commit ports sbus_dbus_connection to use them. Port the internal uses of dbus to use the new scheme in a very minimal way. Further cleanup is possible here. This commit provides basic definitions of the internal dbus interfaces. The interfaces aren't fully defined, as the handlers will continue to unpack manually, and often overload DBus methods with different arguments (which is rather unorthodox, but not the end of the world). Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* nss: Stop using one DBus interface with totally different methodsStef Walter2014-02-243-2/+3
| | | | | | | | | | | | | | | This is an incorrect use of DBus, where we use a single interface name with completely different sets of methods. Easily fixed. Once the vtable stuff is in use then this would be automatically detected and fail to build. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* sbus: Add sbus_vtable and update codegen to support itStef Walter2014-02-247-2/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each interface is a vtable structure derived from sbus_vtable, in the sense that it has an sbus_vtable struct as its first argument. This lets us upcast the interface vtable structure to an sbus_vtable and dispatch to it dynamically and cleanly. The interface metadata contains information about which vtable offset in the interface metadata should be dispatched to for a given function. This is a common scheme, not only among dbus implementations, but also compiled languages. Currently all the vtable functions are of type sbus_msg_handler_fn. These are the handlers we are familiar with and perform raw processing of the message. Later commits will introduce type safe handlers that levelage compile checking and automatic argument packing/unpacking. Although this may seem contrived now, the remainder of the dbus infrastructure work will build on this, including ofd.Properties, ofd.ObjectManager, ofd.Introspect, compiler checked type safe unpacking/packing, etc. The codegen now generates vtable structures for each interface along-side the metadata, and fills in vtable offsets appropriately. It is obviously still possible to hand-craft such vtables and metadata if needed for a special case. Once again examples output can be found at: src/tests/sbus_codegen_tests_generated.h Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* sbus: Add meta data structures and code generatorStef Walter2014-02-247-0/+966
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These metadata structures hold the information about all the details of a DBus interface. They are typically generated from the canonical XML form of the DBus interface, although they may also be hand crafted. Add some handy functions for looking up methods, props, signals, in the metadata of an interface. Currently lookups are just done by looking through an array. If performance becomes an issue (ie: very large interfaces) it would be really easy to sort things and use bsearch(). Later commits will include some definitions using this metadata and related functions. DBus interfaces are defined here: http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format The introspection data format has become the standard way to represent a DBus interface. For many examples see /usr/share/dbus-1/interfaces/ on a typical linux machine. A word about annotations. These are extra flags or values that can be assigned to anything. So far, the codegen supports this annotation: org.freedesktop.DBus.GLib.CSymbol - An annotation specified in the specification that tells us what C symbol to generate for a given interface or method. By default the codegen will build up a symbol name from the DBus name. It is possible to confuse the code generator into producing invalid C code (with strange method names, for example), but the C compiler catches such silliness right away. Add tests testing basic features of the codegen and poking through the metadata it creates. Also test the metadata lookup functions. Generated code is checked in for easy discovery. An example of the XML interface definitions can be found at: src/tests/sbus_codegen_tests.xml And an example of the generated header can be found here: src/tests/sbus_codegen_tests_generated.h Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix warning unused variable ap_fallbackLukas Slebodnik2014-02-211-1/+1
| | | | | | | The variable ap_fallback is used only if sssd is build with journald, but this variable was declared outside of "#ifdef WITH_JOURNALD" Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: Don't fail if apply_subdomain_homedir returns ENOENTJakub Hrozek2014-02-201-1/+1
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* DEBUG: Fix crash after fallback from journal logLukas Slebodnik2014-02-201-2/+5
| | | | | | | | | | | if journal_send fail we should not use the same va_list in the fallback functions. va_list can be modiefied and it may cause crashes im some cases e.g. printing string. This patch use copy of initialised va_list for debug_vprintf function. Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* IPA: Don't call tevent_req_post outside _sendJakub Hrozek2014-02-201-1/+0
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* NSS: Continue if there is no portJakub Hrozek2014-02-201-1/+1
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* ad_account_can_shortcut(): return bool instead of errnoPavel Březina2014-02-191-29/+11
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2210 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Use KRB5_CFLAGS where appropriateAlexey Shabalin2014-02-191-0/+5
| | | | | | | | | | There are cases when MIT Kerberos is installed with includes in a subdirectory of /usr/include (or /usr/local/include). In such case we have to properly use KRB5_CFLAGS to reach them. https://fedorahosted.org/sssd/ticket/2226 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* DEBUG: Fix build without journaldJakub Hrozek2014-02-191-3/+3
| | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* BUILD: Simplify enabling journald on installed systemsStephen Gallagher2014-02-192-0/+27
| | | | | | | | | | | systemd supports overrides of the standard service file to be placed in /etc/systemd/system/<service>.service.d/ With this patch, we will install a commented-out override file to /etc that will instruct the user on how to enable logging to journald. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* DEBUG: Enable sending structured debug logs to journaldStephen Gallagher2014-02-191-0/+90
| | | | | | | | | | | | | | | We are now able to send structured debug logs to journald, tagged with the code file, line number and domain that the log pertains to. To enable this functionality, SSSD must be configured at build-time with --with-syslog=journald and must be launched without -f/--debug-to-files This behavior is nearly identical to how SSSD will function today on a systemd-based system if --debug-to-files is disabled, since it will redirect stdout and stderr into journald. This patch merely enhances the situation to send structured logs instead of simple string messages. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* DEBUG: Allow debug_fn to process __FILE__ and __LINE__Stephen Gallagher2014-02-193-7/+17
| | | | | | | | | | | | | In preparation for enabling journald support for the DEBUG logs, we will need to be able to pass in certain additional arguments that will be required, specifically the code file and line number. We will be able to optionally enable this in the file-based logs as well if we so choose, but for right now we will avoid breaking the log format on disk. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* tests: don't print debug message when test dir does not existPavel Březina2014-02-181-1/+1
| | | | | | | | We delete the test dir before a new test suit is started, to make sure there is no garbage left. The test dir is usually already deleted so in most runs a noisy debug message is printed. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: nested groups unit testPavel Březina2014-02-181-0/+198
| | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2024 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: new macro sss_will_return_alwaysPavel Březina2014-02-181-0/+2
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: mock sysdb users and groupsPavel Březina2014-02-182-0/+241
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: mock SDAPPavel Březina2014-02-182-0/+176
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: add confdb_path to sss_test_ctxPavel Březina2014-02-182-4/+5
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* make make_realm_upper_case() staticPavel Březina2014-02-183-20/+18
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* ldap: move domain related content from ldap_common.c to sdap_domain.cPavel Březina2014-02-182-176/+197
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* ldap: move options related content from ldap_common.c to ldap_options.cPavel Březina2014-02-182-764/+787
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sdap: move sdap_get_id_specific_filter() to sdap_utils.cPavel Březina2014-02-182-20/+20
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sdap: move non async functions from sdap_async_connection.c to sdap_utils.cPavel Březina2014-02-182-18/+18
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sdap: move non async functions from sdap_async.c to sdap_utils.cPavel Březina2014-02-182-118/+142
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Translation: Move german translation to right directoryLukas Slebodnik2014-02-182-1/+11053
| | | | | | | | | po/de.po -> src/man/po/de.po Resolves: https://fedorahosted.org/sssd/ticket/2225 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* MAN: Clarify the new krb5_use_fast IPA defaultJakub Hrozek2014-02-172-1/+35
|
* IPA: default krb5_fast_principal to host/$client@$realmPavel Březina2014-02-171-3/+5
| | | | | | | | If krb5_fast_principal is not set in sssd.conf it was set to host/$client, KRB5 default realm was used which doesn't have to be the same as realm used for IPA, thus authentication failed when using FAST. Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com>
* test_dyndns: Test right variable after allocation.Lukas Slebodnik2014-02-171-1/+1
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* DOC: Fix names of arguments in doxygen commentsLukas Slebodnik2014-02-173-5/+5
| | | | Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* resolv_gethostbyname_dns_parse(): remove tmp_ctxPavel Březina2014-02-171-7/+3
| | | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2198 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* IPA: Default to krb5_use_fast=tryJakub Hrozek2014-02-132-1/+28
| | | | | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com> Reviewed-by: Alexander Bokovoy <abokovoy@redhat.com>
* Remove DEBUG macro support for old debug levelsNikolai Kondrashov2014-02-125-111/+11
| | | | | | | | | | | | | | Remove support for specifying old debug levels to the DEBUG macro: * remove debug_get_level function which was used for conversion, * remove debug_get_level tests, * remove mentions of old/new levels from DEBUG and DEBUG_IS_SET macro descriptions, * rename "newlevel" argument of debug_fn to just "level". Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>