summaryrefslogtreecommitdiffstats
path: root/server
Commit message (Collapse)AuthorAgeFilesLines
* Simplify some aspects of pam_LOCAL_domainSimo Sorce2009-03-043-138/+87
| | | | | | | | | | Use only one context (the local request) for all functions. Use new helper function in sysdb to set numbers as sysdb_attrs values. Do not use pam_status to report internal errors, use an error variable and check it only when we finally reply. Use sysdb_error_to_errno() to convert and ldb error to errno. Do not free every single buffer allocated, they are all appended to the local request and will be automatically freed once the request is finished.
* Improve sysdbSimo Sorce2009-03-044-33/+87
| | | | | | Add comments in header files to better explain interfaces and intended usage. Expose function to convert from ldb errors to errnos. Add sysdb_attrs helper to add a long integer as a value.
* Fixing memory leak in GetUserAttributesStephen Gallagher2009-03-041-1/+2
|
* replaced pure ldb calls with sysdb callsSumit Bose2009-03-033-120/+309
|
* Provide sysdb_set_user_attr() functions.Simo Sorce2009-03-035-4/+157
| | | | | | Provide also helper functions to build struct sysdb_attrs. Also fix sysdb_get_user_attr() to have a consistent interface as all other functions.
* Unify pwd_search and user_searchSimo Sorce2009-03-021-35/+11
|
* Do not steal memory in btreemaps.Simo Sorce2009-03-022-43/+24
| | | | | Just make sure that the memory passed in is either static or allocated on the same memory context that is parent of the btreemap.
* Support byte arrays in InfoPipe GetUserAttributesStephen Gallagher2009-03-021-27/+80
| | | | | | | | We now have support for reading binary blobs such as userpic from the sysdb and returning it to an InfoPipe consumer as a byte array. I also cleaned up some code in create_getattr_result_map to make it easier to read.
* Make tests configurableJakub Hrozek2009-03-023-3/+25
|
* Implement GetUserAttributes in the InfoPipeStephen Gallagher2009-03-0213-58/+911
| | | | | | | | | | | | | | | | | | This patch adds support for requesting user data in the sysdb via the InfoPipe. It currently has support for reading defined entries of integral, floating-point or string types. Tasks remaining: 1) Implement call to the provider when cache is out of date 2) Support byte arrays for userpic and similar I modified sysdb_search_ctx in sysdb_search.c to accept an array of attributes to pass into the LDB search. I also made one additional related fix: the btreemap now sorts in the correct order. Previously I had accidentally transposed the two values for sorting, so the map would always have been in exact reverse order.
* Create and own /var/lib/sss, memberof.so packagingJakub Hrozek2009-03-021-5/+14
| | | | | Own everything in /usr/libexec/sssd in specfile, no nss_client subdir Place memberof.so in /usr/lib/ldb
* first version of LOCAL pam backendSumit Bose2009-03-0211-6/+789
|
* Adapt test to changes to the interface.Simo Sorce2009-02-281-169/+326
| | | | | Only legacy functions are fully tested now. TODO: add new tests for non-legacy backend operations.
* Expose some more functions needed by the testsSimo Sorce2009-02-283-1/+114
|
* Convert sync calls in sysdb to async, transaction dependent, calls.Simo Sorce2009-02-289-1313/+1652
|
* Fix confdb issues.Simo Sorce2009-02-285-110/+67
| | | | | | | | | | | Avoid uninitialized memory messages in valgrind (in _btreemap_get_keys). Do not free memory we just stored in the btree (in confdb_get_domains_list). Streamline confdb_get_domains() and remove extra calls when we already have all the information handy. Do not store basedn in domain info, the base dn is always calculated out of the domain name. Remove the "provider" attribute, it was really used only to distinguish between LOCAL and other domains, directly check for LOCAL as a special case instead.
* Refactor creation of domain_map into confdbStephen Gallagher2009-02-279-200/+211
| | | | | | | | | | | | | | | | | The NSS provider, the Data Provider backends and the InfoPipe all need access to the domain map provided by the confdb. Instead of reimplimenting it in multiple places, it is now provided in a pair of helper functions from the confdb. confdb_get_domains() returns a domain map by reference. Always returns the most up-to-date set of domains from the confdb. confdb_get_domains_list() returns an array of strings of all the domain names. Always returns the most up-to-date set of domains from the confdb. This patch also modifies the btreemap_get_keys() function to better handle memory and report allocation failures.
* Serialize access to sysdb and also exposes ldb transactions.Simo Sorce2009-02-269-780/+1063
| | | | | | This is necessary because in ldb only 1 transaction per context is possible and all operations (or new transactions) are nested within it. Will revisit this later when ldb will addresses the problem.
* Stop building replace.o until we decide if we use it again.Simo Sorce2009-02-261-1/+1
|
* Rebase the code to use talloc, tdb, tevent, ldb as externalSimo Sorce2009-02-2645-323/+213
| | | | | | dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
* Adding InfoPipe entry to config.ldif exampleStephen Gallagher2009-02-252-1/+7
| | | | | | Also updating the .gitignore file to not ignore config.ldif Signed-off-by: Simo Sorce <ssorce@redhat.com>
* added more ldap backend options and an example configurationSumit Bose2009-02-252-68/+107
| | | | Signed-off-by: Simo Sorce <ssorce@redhat.com>
* Simplify the code to retrieve the introspection file.Simo Sorce2009-02-251-31/+50
|
* Store the InfoPipe introspection XML for subsequent requests.Stephen Gallagher2009-02-252-13/+18
| | | | | | | Right now, the introspection XML file is read in every time a client service requests it. Since the XML cannot change during process lifetime, we'll store it on the infp_ctx object so we don't need to hit the filesystem for requests after the first.
* top-level Makefile, create libdir/name in server/Makefile.inJakub Hrozek2009-02-251-0/+1
|
* Add PAM responderSumit Bose2009-02-2428-176/+2991
| | | | | | | Also move responders under server/responder with shared code in server/responder/common Signed-off-by: Simo Sorce <ssorce@redhat.com>
* Fix SEGFAULT in CheckPermissionsStephen Gallagher2009-02-241-1/+2
|
* Proper fix for memory handling problem.Simo Sorce2009-02-2414-161/+313
| | | | | | | | | | sbus_message_handler is not responsible anymore for sending back data in any case. Transfer this responsibility to the handler function called. This way both synchronous and asynchronous funstions use the interface the same way and can properly free memory referenced by the reply after the send buffer has been filled in and all copies are done in sbus_conn_send_reply()
* Revert "Fixing serious memory allocation bug in sbus_message_handler."Simo Sorce2009-02-2412-167/+186
| | | | | | | | | | | | | | | This reverts commit 13421cbe0af4343f9d110600755ffa756690b282. Conflicts: server/infopipe/infopipe.c server/infopipe/infopipe.h While this solution fixed the contingent memory problem it introduced other problems in handling asynchronous replies. Reverting in preparation for a different way to solve it. Conflicts have been taken care of.
* Adding support for CheckPermissions to InfoPipe.Stephen Gallagher2009-02-2410-8/+696
| | | | | | | | | CheckPermissions will currently return unrestricted access to the root user, and no access to any other user. Once we decide on an ACL mechanism, this will be easy to change. I have also added very basic tests for the Introspect and CheckPermissions methods.
* Spec file patch Take 2:Stephen Gallagher2009-02-246-18/+46
| | | | | | | | | | | | | | | Adding support for generating RPMS for sssd. Fixing TDB autoconf macros to require version 1.1.3 and support for the tdb_repack symbol (required by LDB) Updating tdb.h to #include <sys/stat.h> for proper autoconf Build system modifications to simplify RPM generation Fixing RPM build system as recommended during code review Minor tweaks to Makefile and sssd.spec Make policykit and infopipe configurable Soname and symlinks
* Adding support for generating RPMS for sssd.Stephen Gallagher2009-02-241-14/+43
| | | | | | | | | | | | | Fixing TDB autoconf macros to require version 1.1.3 and support for the tdb_repack symbol (required by LDB) Updating tdb.h to #include <sys/stat.h> for proper autoconf Build system modifications to simplify RPM generation Fixing RPM build system as recommended during code review Minor tweaks to Makefile and sssd.spec Make policykit and infopipe configurable Soname and symlinks
* Add D-BUS introspection to InfoPipe This function is necessary to play nice ↵Stephen Gallagher2009-02-245-5/+90
| | | | with D-BUS clients built in multiple languages. It will read in the XML file on the first request and store the returned XML as a component of the sbus_message_handler_ctx for the connection. All subsequent requests during the process' lifetime will be returned from the stored memory. This is perfectly safe, as the available methods cannot change during the process lifetime.
* Fixing serious memory allocation bug in sbus_message_handler.Stephen Gallagher2009-02-2312-169/+156
| | | | | | | | | | | | dbus_message_append_args() adds a reference to memory that is not copied to the outgoing message until dbus_connection_send() is called. Since we compile our reply messages in functions and then return the reply, we need a mechanism for deleting allocated memory after invoking dbus_connection_send. I have changed the arguments to sbus_msg_handler_fn so that it takes a talloc ctx containing the sbus_message_handler_ctx and a pointer to a reply object. We can now allocate memory as a child of the reply context and free it after calling dbus_connection_send.
* Attach the InfoPipe to the D-BUS system bus. InfoPipe is now capable of ↵Stephen Gallagher2009-02-2313-51/+675
| | | | | | | | | | | listening for requests to org.freeipa.sssd.infopipe I made the sbus_add_connection function public so that I could use it for system bus connections. Adding initial framework for the InfoPipe Updating sysdb tests for the refactored sysdb methods.
* Change examples accordingly to changes in the codeSimo Sorce2009-02-202-7/+10
|
* Reorganize sysdb a bit,Simo Sorce2009-02-206-980/+1096
| | | | | | | rename _posix_ function into _legacy_ Add support for the posix legacy mode where memberships are stored in memberUId and not in member/memberof pairs. Do not build sysdb as a library
* Add helper function to get booleans from confdbSimo Sorce2009-02-202-9/+46
|
* Completely rework the nss interface to be able to use 2Simo Sorce2009-02-209-440/+1588
| | | | | | | | | | | | | | | | | | | | | | | | | types of domains: modern and legacy modern uses member/meberof, legacy uses memberUid for group memberships. Rework the proxy backend to use the legacy style as that's the format the data comes in (trying to convert would require too many transformations and increased the number of queries). Add support for fetching groups in nss. Add support for enumerating users and groups (requires to enable enumeration in config) both in nss and in the proxy provider. Remove confdb_get_domain_basedn() and substitute with generic calls in the nss init function. Store a domain structure in the btree not the basedn so that we can add enumeration flags. Also make sure NSS understand how to make multiple calls on enumerations, also make passing the domian parameter always mandatory, passing in domain=* is not valid anymore. This work fixes also a few memory, degfault, and logic bugs found while testing all nss functions (there are still some to fix that are less critical and much harder to find yet).
* Fix another transaction mis-handlingSimo Sorce2009-02-171-22/+20
|
* Modifying sbus_message_handler to return DBUS_ERROR_UNKNOWN_METHOD when the ↵Stephen Gallagher2009-02-161-2/+10
| | | | requested method is not registered with the message handler. Previously, we returned DBUS_HANDLER_RESULT_HANDLED with no indication that nothing had happened.
* Enhancements and bugfixes to util/btreemap.c 1) Remove useless and unused ↵Stephen Gallagher2009-02-163-26/+38
| | | | btreemap_new() 2) Fix potentially serious memory allocation error. btreemap now requires a TALLOC_CTX to be passed in for assignment to the top node of the tree. Previously it was creating a new root TALLOC_CTX 3) Add new function btreemap_get_keys that will return a sorted array (newly allocated using talloc_realloc()) of keys (const void *) 4) Change the btreemap to use (const void *) keys instead of (void *)
* ldb_msg_* functions do not reliably set errno on error, do not realy on that.Simo Sorce2009-02-161-34/+34
| | | | | | | | | | | | This was causing some functions to not cancel a transaction as they should have, leaving it pending indefintely. It in turn meant that no other process could see what was "stored" in the db as transactions are not fluched to the db until "committed". Took me quite a while and a lot of confusion to catch why I was seeing "ghost entries" in some processes and not seeing the entry in others .. As a defensive programming measure make sure we commit OR cancel in the same spot and that we always go thorugh it.
* Make backend requests asyncSimo Sorce2009-02-134-72/+599
|
* Object not found on delete is not really an error.Simo Sorce2009-02-131-10/+10
|
* If we find the service we are doneSimo Sorce2009-02-131-1/+2
|
* Add a separte global checker that does not depend on individualSimo Sorce2009-02-131-28/+91
| | | | services ping time.
* Always pass teh database path explicitly, so that test cases can useSimo Sorce2009-02-1310-47/+223
| | | | | throw away databases Check version and init main db if empty
* Fix add member, remove one to many lines in the previous tidyupSimo Sorce2009-02-131-0/+6
|
* Remove dp_cli_sbus_initSimo Sorce2009-02-123-128/+5
|