summaryrefslogtreecommitdiffstats
path: root/server/sbus
Commit message (Collapse)AuthorAgeFilesLines
* Increase the sbus dispatch DEBUG level to 9Stephen Gallagher2009-11-051-2/+2
| | | | | This is heavy noise and low-usefulness for debugging normal operating issues.
* Remove unused btreemap codeStephen Gallagher2009-10-061-1/+0
| | | | | We have converted to using dhash in place of btreemap everywhere in the code.
* Revert "Use syslog for logging error conditions in SSSD"Stephen Gallagher2009-09-232-9/+9
| | | | | | | | This reverts commit 8c50bd085c0efe5fde354deee2c8118887aae29d. Amended: commit 1016af2b1b97ad4290ccce8fa462cc7e3c191b2e also made use of the SYSLOG_ERROR() macro, so those portions of that code also needed to be reverted.
* Use syslog for logging error conditions in SSSDJakub Hrozek2009-09-212-9/+9
| | | | | This is just a band-aid until ELAPI is fully functional and ready to use.
* Add copyright noticesJakub Hrozek2009-09-113-0/+63
| | | | Fixes: #138
* Correctly handle DbusWatch behavior.Simo Sorce2009-08-312-37/+124
| | | | | | | It seems like DBUS always adds 2 watches for the same fd. One is for reading and the other is for writing. DBUS then keeps disabling one and enabling the other, depending on whether it is interested in reading or writing from/to the file descriptor.
* Change services identification mechanismSimo Sorce2009-08-111-3/+4
| | | | | | | Let services identify themselves voiluntarily as the first operation instead of polling from the monitor. Also consolidate some common functions and make them available as monitor helpers.
* Minor fixesSimo Sorce2009-08-112-7/+13
|
* Simplify interfaces initializationSimo Sorce2009-08-106-100/+93
| | | | | | | Make as much as possible static, and remove use of talloc_reference and allocation/deallocation of memory when not necessary. Fix also responder use of rctx->conn, was mistakenly used for both monitor and dp connections.
* merge server and connection structuresSimo Sorce2009-08-107-253/+212
| | | | | | This reduce code duplication as it allows to use one set of watch and timeout functions, and at the same time also allow not to use a secondary structure just to unify these functions.
* Cosmetic changesSimo Sorce2009-08-105-179/+179
| | | | | Rationalize and rename connection names in preparatoin for merging of server and connection structures.
* Remove redundant memory contextsSimo Sorce2009-08-104-53/+22
| | | | Simplify code by removing stuff that is never used or redundant.
* Refactor some code around watches and timeoutsSimo Sorce2009-08-104-355/+324
| | | | | | | | | | Watches and Timeouts are now unified under one implementation that covers both dbus server and connections. In watches do not keep removing and adding file events simply toggle the appropriate flags. Also streamline some memory management within both timeout and watch related functions, checking allocations and freeing the whole context not just the events.
* CleanupsSimo Sorce2009-08-102-189/+199
| | | | | Minor style cleanups, and some name consistency cleanups that make some names a bit more meaningful and/or shorter.
* Allow configuration of the SSSD through /etc/sssd/sssd.confStephen Gallagher2009-04-131-0/+1
| | | | | | | | | | | | | | | | | | | The SSSD now links with the ini_config and collection libraries in the common directory. The monitor will track changes to the /etc/sssd/sssd.conf file using inotify on platforms that support it, or polled every 5 seconds on platforms that do not. At startup or modification of the conf file, the monitor will purge the existing confdb and reread it completely from the conf file, to ensure that there are no lingering entries. It does this in a transaction, so there should be no race condition with the client services. A new option has been added to the startup options for the SSSD. It is now possible to specify an alternate config file with the -c <file> at the command line.
* Fix SBUS handling of unknown messagesStephen Gallagher2009-04-081-0/+2
| | | | | This was missed when we moved away from using the message_handler for sending replies (in order to support async processing).
* allow compilation with older version of dbusSumit Bose2009-04-012-0/+8
|
* Add reconnection logic to the SBUSStephen Gallagher2009-03-202-1/+206
| | | | | | | | Any client of the SBUS that wants to implement automatic reconnection may now call sbus_reconnect_init to set it up. The clients will need to set up a callback to handle the result of the reconnection and (in the case of a successful reconnection) readd the method handlers to the connection context.
* Add sbus_reply_internal_error() feature to sbus_message_handler()Stephen Gallagher2009-03-061-2/+14
| | | | | | | If an SBUS function returns an error code, we'll immediately return an error reply to the client stating "Internal Error" instead of ignoring the request and forcing the client to wait for a timeout.
* Implement SetUserAttributes in the InfoPipeStephen Gallagher2009-03-042-0/+37
| | | | | | | | | SetUserAttributes is now available for use in the Infopipe. I also reorganized a few of the internal InfoPipe objects to reduce code duplication. One very simple test is included in this checkin to validate that the parser is working.
* Implement GetUserAttributes in the InfoPipeStephen Gallagher2009-03-022-0/+31
| | | | | | | | | | | | | | | | | | 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.
* Rebase the code to use talloc, tdb, tevent, ldb as externalSimo Sorce2009-02-266-51/+50
| | | | | | dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
* Proper fix for memory handling problem.Simo Sorce2009-02-243-16/+19
| | | | | | | | | | 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-242-29/+11
| | | | | | | | | | | | | | | 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.
* Add D-BUS introspection to InfoPipe This function is necessary to play nice ↵Stephen Gallagher2009-02-241-0/+1
| | | | 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-232-11/+29
| | | | | | | | | | | | 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-233-10/+55
| | | | | | | | | | | 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.
* 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.
* Refactoring the monitor code and SBUS utility functions.Stephen Gallagher2009-01-272-0/+121
|
* Add code to make it easier to reconnect in case the serverSimo Sorce2009-01-142-0/+7
| | | | | is not available immediately or drops the dbus connection. First step is the nss connection to the data provider.
* Lots of little nasty bugs fixed.Simo Sorce2009-01-091-4/+4
| | | | | | | I was finally able to get a getpwnam() request go through sssd, hit the remote ldap server and get the answer back with 'getent passwd foo' Yupiee!
* SBUS messages with no reply (or no immediate reply) would incorrectly report ↵Stephen Gallagher2009-01-061-3/+2
| | | | | | | | DBUS_HANDLER_NOT_YET_HANDLED. This would cause SBUS to report NOT_IMPLEMENTED to the calling function. The message_handler will now check the return code of the method call to determine which reply to send, instead of relying on the presence of a reply message.
* libevents renamed upstream to libteventSimo Sorce2008-12-223-3/+3
| | | | events.h -> tevent.h
* Modified sbus_server_new() to take a talloc memory context to useStephen Gallagher2008-12-152-3/+5
| | | | as a parent for the new server context object.
* Adding a parameter to the sbus_service_sbus_init function to allow passing ↵Stephen Gallagher2008-12-151-1/+5
| | | | in an sbus_conn_destructor_fn to the sbus_new_connection() function. Fixing minor warning about the usage of talloc_reference.
* Disconnected client SBUS connections would delete the master set of ↵Stephen Gallagher2008-12-153-4/+9
| | | | | | | | sbus_method_ctx entries, meaning that the next connection to attempt to disconnect would receive a segmentation fault also trying to delete them. They are now talloc_reference()-ed to their connection context and talloc_unlink()-ed upon deletion. I have also modified the sbus_new_server() call to take a reference to an sbus_srv_ctx object as a return argument, so that the calling function can keep track of the SBUS server context if it so chooses.
* Fix indentation to follow rulesSimo Sorce2008-12-101-21/+29
|
* Fix dbus related memory leaksSimo Sorce2008-12-091-2/+4
|
* REmove test client. It's not needed anymore.Simo Sorce2008-11-241-214/+0
|
* Created a helper function sssd_service_sbus_init() to simplify creating the ↵Stephen Gallagher2008-11-201-0/+2
| | | | initial connection to the monitor service within the child services. It will create the D-BUS connection to the monitor and configure the service to handle the mandatory getIdentity and ping methods.
* Start conversion from a fork() and live to a fork()/exec() model.Simo Sorce2008-11-203-26/+27
| | | | | To start the dameon now you need to pass the option -s monitor Still have some problems communicating with children.
* Add method to get a connection's private dataSimo Sorce2008-11-193-7/+13
| | | | | | | Fix memory hierarchy, set the destructor on the server context so that it is called before any memory attached to it is freed. Before this change a talloc_free() on the event context would end in a double free and and an abort() inside talloc.
* The default message handler will now pass both the method_ctx and theStephen Gallagher2008-11-173-21/+42
| | | | | | | sbus_conn_ctx to all message handling functions. This will allow connection-specific data to be passed in by taking advantage of the sbus_conn_set_private_data() function on the sbus_conn_ctx struct. Presently this private data is global to all methods of the connection context.
* Fix trailing spaces and some indentation issues.Simo Sorce2008-11-131-46/+57
|
* Add the ping funtion to the nss service Make the monitor task ping ↵Simo Sorce2008-11-043-59/+77
| | | | connecting services Make it possible to configure timeouts and service ping times.
* Add support for dbus comunication in the nss serviceSimo Sorce2008-11-031-6/+5
| | | | | Add utility function in confdb Make all component fetch the dbus socket from the confdb
* Use a common interface file for all users of the internalSimo Sorce2008-11-031-10/+1
| | | | sbus service.
* Renaming sssd/server/dbus to sssd/server/sbus. Making necessary changes to ↵Stephen Gallagher2008-11-036-0/+1260
header includes and makefiles.