summaryrefslogtreecommitdiffstats
path: root/Makefile.am
Commit message (Collapse)AuthorAgeFilesLines
* sss_config: buildPavel Březina2014-05-141-0/+17
| | | | Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* IFP: Per-attribute ACL for usersJakub Hrozek2014-05-131-1/+1
| | | | | | | | | | | Introduces a new option called user_attributes that allows to specify which user attributes are allowed to be queried from the IFP responder. By default only the default POSIX set is allowed, this option allows to either add other attributes (+attrname) or remove them from the default set (-attrname). Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* Implemented LDAP component of GPO-based access controlYassir Elley2014-05-131-0/+12
| | | | | Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IFP: Add utility functionsJakub Hrozek2014-05-131-1/+22
| | | | | | | | | | | | | Adds a number of utility functions, most importanly ifp_req_create(). The ifp_req is a structure that will be passed along with the ifp request and would provide easy access to both the sbus_request data and per-responder data, like the ifp_ctx. Also includes a utility function to split a path prefix from a full path and add a ldb_element into a dictionary. These will be reused later. Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Stef Walter <stefw@redhat.com>
* SBUS: Add an async request to retrieve the caller IDJakub Hrozek2014-05-131-0/+22
| | | | | | | | | | | | | | | | | Adds an async request sbus_get_sender_id_{send,recv} that allows retrieval of UID based on "sender" as returned by dbus_message_get_sender(). The UID is an int64_t to be able to use "-1" to as a fallback value for uknown or error cases. The unit test is added as a standalone one, not part of the sbus_tests because the request, and by extension the unit test relies on being connected to the system bus, which is very unlikely to work in a build system. Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Stef Walter <stefw@redhat.com>
* TEST: Link ipa_ldap_opt test with openldap libsLukas Slebodnik2014-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | The test ipa_ldap_opt has undefined symbols from libldap and liblber, but it was not directly linked with openldap libraries. sh-4.2$ nm --undefined-only .libs/ipa_ldap_opt-tests | grep -E "ldap|ber" U ber_free U ldap_err2string It causes linker failure on systems with disabled link_all_deplibs (debian) /usr/bin/ld: src/providers/ldap/ipa_ldap_opt_tests-sdap.o: undefined reference to symbol 'ber_free' /usr/bin/ld: note: 'ber_free' is defined in DSO /lib64/liblber-2.4.so.2 so try adding it to the linker command line /lib64/liblber-2.4.so.2: could not read symbols: Invalid operation clang: error: linker command failed with exit code 1 (use -v to see invocation) Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* LDAP: Fix off-by-one bug in sdap_copy_optsJakub Hrozek2014-05-021-0/+3
| | | | | | | | The sdap_copy_opts function copied all the arguments except for the sentinel. Reviewed-by: Simo Sorce <simo@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* RESPONDERS: Add a new request sss_parse_inp_sendJakub Hrozek2014-04-221-0/+17
| | | | | | | | | The responders were copying code to parse input and on encountering an uknown domain, send the discover subdomain request. This patch adds a reusable request that can always be called in responders and in case the name can be parsed, just shortcut. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* TESTS: Split a separate common_mock_resp_dp moduleJakub Hrozek2014-04-221-0/+1
| | | | | | | | Splitting the module would allow responders that test the Data Provider requests to use the mock_rctx/mock_cctx functions without duplicate definitions. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* build: List test extensionsNikolai Kondrashov2014-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | List test extensions with TEST_EXTENSIONS [1] in Makefile.am to allow applying separate LOG_COMPILER for binary and Python tests. This is needed to avoid running Python tests under Valgrind as that produces too many interpreter-specific errors which are hard to suppress reliably [2]. Thus a run like this would run only binary tests under Valgrind: make check PY_LOG_COMPILER=env LOG_COMPILER=valgrind Or more briefly: make check LOG_COMPILER=valgrind [1] http://www.gnu.org/software/automake/manual/automake.html#index-TEST_005fEXTENSIONS [2] http://svn.python.org/projects/python/trunk/Misc/README.valgrind Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sbus_codegen_tests: Add test case type-safe handler argsStef Walter2014-04-191-0/+1
| | | | | | This adds a big test case for invoking a handler with all supported basic arguments, and constructing a reply with the same. Lots of tedious code, but worth it to make sure things work well.
* build: Don't assume systemd implies journaldNikolai Kondrashov2014-04-171-1/+3
| | | | | | | | | | | | | Don't add --with-syslog=journald to extra_distcheck_flags if configured with systemd (--with-initscript=systemd). Add it if configured with journald (--with-syslog=journald) instead. This fixes distcheck target when configured with systemd, but without journald. Don't install journal.conf helping with enabling journald logging, unless configured with journald (--with-syslog=journald), as it would be useless and misleading. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* BUILD: Move duplicated files from providers to libsss_ldap_common.soLukas Slebodnik2014-04-161-20/+14
| | | | | | | | | | | | | | Files sss_ldap.c, user_info_msg.c were built in libsss_{ad,ipa,ldap}.so. In these two files, there are functions sss_ldap_get_diagnostic_msg, pack_user_info_chpass_error which are needed in libsss_ldap_common.so sss_ldap_get_diagnostic_msg is used in src/providers/ldap/sdap_async.c, src/providers/ldap/sdap_async_connection.c pack_user_info_chpass_error is used in src/providers/ldap/ldap_auth.c Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Move file sss_krb5.c into libsss_krb5_common.soLukas Slebodnik2014-04-161-22/+13
| | | | | | | | | | | | | Functions from module sss_krb5.c were duplicated in many libraries. e.g. symol check_fast was in libsss_ad.so, libsss_ipa.so, libsss_krb5.so, libsss_ldap.so This patch also remove duplicate files between libsss_ldap.so and libsss_krb5_common.so. libsss_ldap.so has already depended on libkrb5. Now, it will depend on libsss_krb5_common.so Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Move file find_uid.c into libsss_util.soLukas Slebodnik2014-04-161-32/+12
| | | | | | | | | Functions from module find_uid.c were duplicated in many libraries. e.g. symol check_if_uid_is_active was in libsss_ad.so, libsss_ipa.so, libsss_krb5.so, libsss_ldap.so Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Link libsss_ldap_common.so to libsss_idmap.soLukas Slebodnik2014-04-161-2/+3
| | | | | | | | | | | | | | | | | | | Library libsss_ldap.so does not directly use functions from library libsss_idmap.so. It only call function sdap_idmap_init (from file sdap_idmap.c) which is in library libsss_ldap_common.so sh-4.2$ nm -D --undefined-only /usr/lib64/sssd/libsss_ldap.so | grep idmap U sdap_idmap_init On the other hand, libsss_ldap_common.so uses functions from libsss_idmap but it was not linked to libsss_idmap.so. sh-4.2$ objdump -p /usr/lib64/sssd/libsss_ldap_common.so | grep idmap sh-4.2$ echo $? 1 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* BUILD: Link libsss_krb5_common.so to libkeyutils.soBenjamin Franzke2014-04-161-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | The symbol add_key (from libkeyutils) is used by function add_user_to_delayed_online_authentication (from file src/providers/krb5/krb5_delayed_online_authentication.c) which is part of libsss_krb5_common.so Fixes following error: [sssd[be[default]]] [load_backend_module] (0x0010): Unable to load ad module with path (/usr/lib64/sssd/libsss_ad.so), error: /usr/lib64/sssd/libsss_krb5_common.so: undefined symbol: add_key -lkeyutils was passed to the libraries libsss_{krb5,ipa,ad}.so, but when compiling with -Wl,--as-needed this flag will be ignored, since it is not used directly. So it was unavailable to libsss_krb5_common.so which actually needs it. This patch removes $(KEYUTILS_LIBS) from those libraries and adds it to libsss_krb5_common.so Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* SBUS: Generate introspection from the interface meta structureJakub Hrozek2014-04-151-0/+1
| | | | | | | | | | | | https://fedorahosted.org/sssd/ticket/2234 This patch generates the introspection data from the sbus interface meta structure. The generated XML conforms to http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format The XML description of the interface also always includes the org.freedesktop.DBus.Introspectable interface, which this patch also allows in the policy settings.
* AUTOMAKE: Do not include generated files into tarballLukas Slebodnik2014-04-111-12/+12
| | | | | | | | | | | | | | | | | | sssd.service was assigned to the dist_systemdunit_DATA variable. Automake will install this file into the systemd unit directory after building it if necessary. Automake will also include this generated file in the tarball. As a result, when building sssd from the tarball, the paths needn't be recreated. The files in DATA primaries are added as dependencies to the all target via the internal all-am target. If sssd.service doesn’t exist, make will look for a rule to build it. Since there is such a rule, make will simply execute that rule when I build the all target. Resolves: https://fedorahosted.org/sssd/ticket/2314 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Makefile: Use alternative method to replace *bindirLukas Slebodnik2014-04-041-0/+27
| | | | | | | | | | | | | | | | | | | https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Installation-Directory-Variables.html Most of these variables have values that rely on prefix or exec_prefix. It is deliberate that the directory output variables keep them unexpanded: typically ‘@sbindir@’ is replaced by ‘${exec_prefix}/sbin’, not ‘/usr/local/sbin’. This behavior is mandated by the GNU Coding Standards. Installation directory variables (sbindir, pkgdatadir ...) should be used only in makefiles. Similarly, we should not rely on AC_CONFIG_FILES to replace sbindir and friends in shell scripts and other files; instead, let make manage their replacement. Resolves: https://fedorahosted.org/sssd/ticket/2293 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IFP: do not create client socketPavel Březina2014-04-041-1/+0
| | | | | | | | | | There is no need for client socket in IFP responder, since it uses D-Bus for communication with clients. Resolves: https://fedorahosted.org/sssd/ticket/2290 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IFP: Connect to the system busJakub Hrozek2014-04-041-1/+8
| | | | | | | | | Related: https://fedorahosted.org/sssd/ticket/2072 Adds the possibility for the InfoPipe responder to connect to the system bus. At the moment, only a dummy method "Ping" is provided. The method only accepts a single string parameter that has to be 'ping'.
* IFP: Re-add the InfoPipe serverJakub Hrozek2014-04-041-0/+19
| | | | | | | | Related: https://fedorahosted.org/sssd/ticket/2072 This commit only adds the responder and the needed plumbing. No DBus related code is in yet.
* IFP: Fix a typo in the MakefileJakub Hrozek2014-04-041-1/+1
|
* cmocka-unit-test-for-functions-getpwuid*-addedPallavi Jha2014-04-031-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* BUILD: Enable additional compiler warningsLukas Slebodnik2014-03-141-2/+2
| | | | Reviewed-by: Pavel Reichl <preichl@redhat.com>
* sbus_tests: Add some testing of dispatch and handler codeStef Walter2014-03-141-0/+11
| | | | | | | | | | | | | This starts a DBus server with some handlers, and runs some method calls against it. Note that we don't use the codegen in the sbus_tests, as we sorta want to test this non-codegen related functionality on its own before we run the sbus_codegen_tests. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* sbus: Add struct sbus_request to represent a DBus invocationStef Walter2014-03-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct sbus_request represents a request from a dbus client being handled by a dbus server implementation. The struct contains the message, connection and method (and in the future teh property) which is being requested. In the future it will contain caller information as well. sbus_request is a talloc memory context, and is a good place to attach any allocations and memory specific to the request. Each handler accepts an sbus_request. If a handler returns EOK, it is assumed that the handler will finish the request. Any of the sbus_request_*finish() methods can be used to complete the request and send back a reply. sbus_request_return_and_finish() uses the same argument varargs syntax as dbus_message_append_args(), which isn't a great syntax. Document it a bit, but don't try to redesign: The marshalling work (will follow this patch set) will remove the need to use varargs for most DBus implementation code. This patch migrates the monitor and data provider dbus code to use sbus_request, but does not try to rework the talloc context's to use it. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* Makefile: Add missing library to the dp_opt_testsLukas Slebodnik2014-03-101-0/+1
| | | | | | | | | | | | dp_opt_tests cannot be linked properly if link_all_deplibs is disabled (debian) /usr/bin/ld: src/tests/cmocka/dp_opt_tests-test_dp_opts.o: undefined reference to symbol 'poptFreeContext@@LIBPOPT_0' /usr/bin/ld: note: 'poptFreeContext@@LIBPOPT_0' is defined in DSO /lib64/libpopt.so.0 so try adding it to the linker command line /lib64/libpopt.so.0: could not read symbols: Invalid operation Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* Unit-test-for-negcache-module-addedPallavi Jha2014-03-051-0/+17
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* config API: prepend source dir search path for testsSumit Bose2014-03-021-0/+2
| | | | | | | | | | | Instead of appending the search patch in the source directory should be prepended. Otherwise the test might find files installed in the default paths of the system first. As a result the compiled python files in the build directory must be remove in the clean target to make 'make distcheck' pass. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* config API: read only specific files from schemaplugindirSumit Bose2014-03-021-1/+2
| | | | | | | | | | | | | | | Currently the config API read any file in the schema plugin dir, typically /usr/share/sssd/sssd.api.d. If there are any unexpected files, like e.g. editor copies or backups, the python code might break because it cannot parse the files. With this patch only files matching the pattern '^sssd-.*\.conf$' are read from this directory. Additionally this patch contains a file which will break the config API self test if it is not filtered out correctly. Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
* SUDO: AD providerSumit Bose2014-03-021-0/+5
| | | | | | | | | | | | | | This patch adds the sudo target to the AD provider. The main reason is to cover different default settings in the LDAP and AD provider. E.g. the default for ldap_id_mapping is True in the AD provider and False in the LDAP provider. If ldap_id_mapping was not set explicitly in the config file both components worked with different setting. Fixes https://fedorahosted.org/sssd/ticket/2256 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* libsss_idmap: bump version-infoSumit Bose2014-02-261-1/+1
| | | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
* DP: Provide separate dp_copy_defaults functionJakub Hrozek2014-02-261-0/+12
| | | | | | https://fedorahosted.org/sssd/ticket/2257 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* IPA: refactor idmap code and add testSumit Bose2014-02-261-0/+15
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sbus: Rework sbus to use interface metadata and vtablesStef Walter2014-02-241-5/+25
| | | | | | | | | | | | | | | | | | | | 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>
* sbus: Add sbus_vtable and update codegen to support itStef Walter2014-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-241-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Use KRB5_CFLAGS where appropriateAlexey Shabalin2014-02-191-2/+10
| | | | | | | | | | 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>
* BUILD: Simplify enabling journald on installed systemsStephen Gallagher2014-02-191-0/+9
| | | | | | | | | | | 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>
* tests: nested groups unit testPavel Březina2014-02-181-0/+14
| | | | | | Resolves: https://fedorahosted.org/sssd/ticket/2024 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: prepare makefile for provider related unit testsPavel Březina2014-02-181-0/+11
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: mock sysdb users and groupsPavel Březina2014-02-181-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* tests: mock SDAPPavel Březina2014-02-181-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* ldap: move domain related content from ldap_common.c to sdap_domain.cPavel Březina2014-02-181-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* ldap: move options related content from ldap_common.c to ldap_options.cPavel Březina2014-02-181-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* sdap: move non async functions from sdap_async.c to sdap_utils.cPavel Březina2014-02-181-0/+1
| | | | Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
* IPA: explicitly link libsss_ipa with selinux libraryLukas Slebodnik2014-02-171-0/+1
| | | | | | | | | | Function selinux_policy_root is used in the module ipa_selinux.c by macro selogin_path, but libsss_ipa.so was not linked with selinux library It was not problem because another libraries depens on selinux.so libsss_ipa.so -> libk5crypto.so -> libkrb5support.so -> libselinux.so We should not rely on dependencies of other libraries. Reviewed-by: Pavel Březina <pbrezina@redhat.com>
* Makefile: Remove unused librariesLukas Slebodnik2014-02-121-5/+0
| | | | | ldap_child, krb5_child do not use any function from libsss_child, libtevent and openldap libraries