summaryrefslogtreecommitdiff
path: root/server
AgeCommit message (Collapse)AuthorFilesLines
2009-02-28Fix confdb issues.Simo Sorce5-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.
2009-02-27Refactor creation of domain_map into confdbStephen Gallagher9-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.
2009-02-26Serialize access to sysdb and also exposes ldb transactions.Simo Sorce9-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.
2009-02-26Stop building replace.o until we decide if we use it again.Simo Sorce1-1/+1
2009-02-26Rebase the code to use talloc, tdb, tevent, ldb as externalSimo Sorce45-323/+213
dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
2009-02-25Adding InfoPipe entry to config.ldif exampleStephen Gallagher2-1/+7
Also updating the .gitignore file to not ignore config.ldif Signed-off-by: Simo Sorce <ssorce@redhat.com>
2009-02-25added more ldap backend options and an example configurationSumit Bose2-68/+107
Signed-off-by: Simo Sorce <ssorce@redhat.com>
2009-02-25Simplify the code to retrieve the introspection file.Simo Sorce1-31/+50
2009-02-25Store the InfoPipe introspection XML for subsequent requests.Stephen Gallagher2-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.
2009-02-25top-level Makefile, create libdir/name in server/Makefile.inJakub Hrozek1-0/+1
2009-02-24Add PAM responderSumit Bose28-176/+2991
Also move responders under server/responder with shared code in server/responder/common Signed-off-by: Simo Sorce <ssorce@redhat.com>
2009-02-24Fix SEGFAULT in CheckPermissionsStephen Gallagher1-1/+2
2009-02-24Proper fix for memory handling problem.Simo Sorce14-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()
2009-02-24Revert "Fixing serious memory allocation bug in sbus_message_handler."Simo Sorce12-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.
2009-02-24Adding support for CheckPermissions to InfoPipe.Stephen Gallagher10-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.
2009-02-24Spec file patch Take 2:Stephen Gallagher6-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
2009-02-24Adding support for generating RPMS for sssd.Stephen Gallagher1-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
2009-02-24Add D-BUS introspection to InfoPipe This function is necessary to play nice ↵Stephen Gallagher5-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.
2009-02-23Fixing serious memory allocation bug in sbus_message_handler.Stephen Gallagher12-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.
2009-02-23Attach the InfoPipe to the D-BUS system bus. InfoPipe is now capable of ↵Stephen Gallagher13-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.
2009-02-20Change examples accordingly to changes in the codeSimo Sorce2-7/+10
2009-02-20Reorganize sysdb a bit,Simo Sorce6-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
2009-02-20Add helper function to get booleans from confdbSimo Sorce2-9/+46
2009-02-20Completely rework the nss interface to be able to use 2Simo Sorce9-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).
2009-02-17Fix another transaction mis-handlingSimo Sorce1-22/+20
2009-02-16Modifying sbus_message_handler to return DBUS_ERROR_UNKNOWN_METHOD when the ↵Stephen Gallagher1-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.
2009-02-16Enhancements and bugfixes to util/btreemap.c 1) Remove useless and unused ↵Stephen Gallagher3-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 *)
2009-02-16ldb_msg_* functions do not reliably set errno on error, do not realy on that.Simo Sorce1-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.
2009-02-13Make backend requests asyncSimo Sorce4-72/+599
2009-02-13Object not found on delete is not really an error.Simo Sorce1-10/+10
2009-02-13If we find the service we are doneSimo Sorce1-1/+2
2009-02-13Add a separte global checker that does not depend on individualSimo Sorce1-28/+91
services ping time.
2009-02-13Always pass teh database path explicitly, so that test cases can useSimo Sorce10-47/+223
throw away databases Check version and init main db if empty
2009-02-13Fix add member, remove one to many lines in the previous tidyupSimo Sorce1-0/+6
2009-02-12Remove dp_cli_sbus_initSimo Sorce3-128/+5
2009-02-12Add syntaxes for member and memberofSimo Sorce1-0/+8
2009-02-12Fix copy&paste errorSimo Sorce1-1/+1
2009-02-12Add indexes and attribute types for common attributesSimo Sorce1-0/+18
2009-02-12- make all functions supposed to get input in posix formatSimo Sorce4-315/+240
use the same namespace (sysdb_posix_) - no need to explicitly start a transaction if only one operation is performed using a synchronous interface - split _add_remove_ functions into separate functions, don't let ldap madness creep into out interfaces
2009-02-12Added sysdb_remove_group_posix and sysdb_remove_group_posix_by_gidStephen Gallagher3-19/+253
Fixed a few small bugs in sysdb_[store|remove]_account_posix. The string "uid=" needed to be replaced with SYSDB_PW_NAME, and the search scope in sysdb_remove_account_posix_by_uid needed to be LDB_SCOPE_ONELEVEL, not LDB_SCOPE_BASE. Added associated unit tests. Modified the unit test structure so that it is called as a single suite, rather than a User and Group suite, since there is too much overlap.
2009-02-12Add support for removing members from groups. Updated convenience functions ↵Stephen Gallagher3-68/+184
for adding/removing user accounts and POSIX groups to the groups. Also modified the add/remove member functions to be a single interface taking a flag for add or removal, since the code only differs by one LDB flag. Added associated unit tests.
2009-02-12Add sysdb_add_group_to_posix_group, refactored sysdb_add_acct_to_posix_group ↵Stephen Gallagher3-92/+236
to now use sysdb_add_member_to_posix_group along with sysdb_add_member_to_posix_group. Added new unit tests to sysdb-tests.c for groups of groups.
2009-02-12Adding sysdb_add_acct_to_posix_group and associated unit testsStephen Gallagher3-27/+462
2009-02-12Adding sysdb_store_group_posix with unit testStephen Gallagher8-18/+374
2009-01-28server.mk was included twice by mistakeSimo Sorce1-2/+0
2009-01-28Simplify delete path by removing effectively redundant code.Simo Sorce1-221/+41
Thanks Nathan for the review that lead to this!
2009-01-28Add comments on how memberof works.Simo Sorce2-1/+97
Enable memberof by default in the default db example
2009-01-28Add a memberof plugin so that we can properly apply the same group membershipsSimo Sorce4-7/+2315
as in IPA if necessary. This patch slightly modifies ldb to split out a modules header file without exposing the private headers.
2009-01-28Move install directiuves into Makefile.inSimo Sorce2-6/+4
2009-01-27Preliminary support for enabling InfoPipe to listen on the D-BUS system bus. ↵Stephen Gallagher9-4/+183
It will connect and authenticate successfully (using the included D-BUS policy file installed in the correct /etc directory. Does not yet listen for requests.