summaryrefslogtreecommitdiffstats
path: root/src/responder/common
Commit message (Collapse)AuthorAgeFilesLines
* Use the correct hash table for pending requestsSimo Sorce2012-03-093-6/+10
| | | | | | | | | | | | | The function that handled pending requests on reconnect was checking an orphaned global variable that was never used, redenring the whole function uselsess. This fixes a very nasty bug that was causing requests for which we never received an answer for (for example because the backend failed and was restarted) to be never removed and therefore causing a black hole effect for any other request of the same type. Fixes: https://fedorahosted.org/sssd/ticket/1229
* RESPONDERS: Allow increasing the file-descriptor limitStephen Gallagher2012-02-172-0/+39
| | | | | | | This patch will increase the file descriptor limit to 8k or the limits.conf maximum, whichever is lesser. https://fedorahosted.org/sssd/ticket/1197
* Remove setent structure when callback is calledJakub Hrozek2012-02-132-11/+11
|
* Fix group enumerationJakub Hrozek2012-02-101-2/+7
| | | | | | Also adds some more debugging and fixes a code style issue. https://fedorahosted.org/sssd/ticket/1182
* DP: Add support for hosts in sss_dp_get_accountJan Cholasta2012-02-072-2/+13
| | | | Host requests are directed to the host info handler.
* AUTOFS: responderJakub Hrozek2012-02-051-0/+2
|
* Split the logic to check cache expiration into separate functionJakub Hrozek2012-02-052-0/+56
|
* RESPONDERS: Refactor setent_req_listJakub Hrozek2012-02-052-5/+90
| | | | | Makes the setent_add_ref() and setent_notify_*() functions more generic to be reusable by the autofs responder.
* RESPONDERS: Provide a common sss_cmd_send_error functionJakub Hrozek2012-02-022-0/+18
| | | | The common function could be reused in new responders
* Refactor nss_cmd_send_emptyJakub Hrozek2012-01-312-0/+39
|
* NSS: Add service enumeration support to NSS providerStephen Gallagher2012-01-271-0/+3
|
* DP: Refactor responder_dp_req so it's reusable by other respondersJakub Hrozek2012-01-272-239/+347
| | | | | | | | | | | | | | | | | | | | | | | | * the internal request is now more generic and is decoupled from account-specific data. There is a new sss_dp_issue_request() wrapper that issues a BE request or registers a callback * the public requests all use struct sss_dp_req_state as the tevent_req state data. This allows to report back data from the internal request even if the caller is just a callback notifier * each specific request now uses an _info structure that contains all the data necessary to construct a DBusMessage passed to provider * each specific request now defines a sss_dp_get_$data_msg callback that is called from the sss_dp_issue_request() common wraper. The purpose of the wrapper is to construct a DBusMessage and bind it to a DBus method so the message can be just sent over to back end The miscellanous changes include: * change SSS_DP_ constants to an enum. This way, a switch() would error if a value is not handled. * rename sss_dp_get_account_int_send() to sss_dp_internal_get_send() request because the internal request is going to handle more than just account data * the DBus return values were renamed from err_maj, err_min to dp_err and dp_ret respectively
* NSS: Add negative cache routines for servicesStephen Gallagher2012-01-272-3/+132
|
* DP: Add support for services in dp requestsStephen Gallagher2012-01-272-0/+4
|
* DP: Fix bugs in sss_dp_get_account_intStephen Gallagher2012-01-231-66/+44
| | | | | | | | | | | | | | | | | | | | | | | The conversion to the tevent_req style introduced numerous bugs related to memory management of the various client requests. In some circumstances, this could cause memory corruption and segmentation faults in the NSS responder. This patch makes the following changes: 1) Rename the internal lookup from subreq to sidereq, to indicate that it is not a sub-request of the current lookup (and therefore is not cancelled if the current request is). 2) Change the handling of the callback loops since they call tevent_req_[done|error], which results in them being freed (and therefore removed from the cb_list. This was the source of the memory corruption that would occasionally result in dereferencing an unreadable request. 3) Remove the unnecessary sss_dp_get_account_int_recv() function and change sss_dp_get_account_done() so that it only frees the sidereq. All of the waiting processes have already been signaled with the final results from sss_dp_get_account_int_done()
* RESPONDER: Extend sss_dp_account_send() to include extra dataStephen Gallagher2012-01-212-8/+26
| | | | | | | Some NSS maps such as 'services' require more values to be passed to the data provider than just the name or ID. In these cases, we will amend an optional component to filter value to pass to the data provider backend.
* PAM: make initgroups timeout work across multiple clientsStephen Gallagher2011-12-201-2/+0
| | | | | | | | | | | Instead of timing out the initgroups lookup on a per-cctx basis, we will maintain a hash table of recently-seen users and use this instead. This will allow SSSD to handle user's logging into multiple services simultaneously more graciously, as well as playing nicer with SSH (which makes calls to PAM both before and after a fork). https://fedorahosted.org/sssd/ticket/1063
* DP: Remove processed callbacksJakub Hrozek2011-12-161-3/+5
|
* Use the case sensitivity flag in respondersJakub Hrozek2011-12-163-24/+122
|
* Responders: Split getting domain by name into separate functionJakub Hrozek2011-12-162-0/+15
|
* Allow using Glib for UTF8 supportStephen Gallagher2011-12-051-9/+1
|
* RESPONDER: Refactor DP requests into tevent_req styleStephen Gallagher2011-11-293-366/+481
|
* RESPONDER: Ensure that all input strings are valid UTF-8Stephen Gallagher2011-11-182-0/+11
|
* RESPONDER: Fix segfault in sss_packet_send()Stephen Gallagher2011-11-021-0/+5
| | | | | | | | | There are several places (all error-handling) where sss_cmd_done() is called with no response packet created. As a short-term solution, we need to check whether the packet is NULL and simply return EINVAL. client_send() (the consumer) will then forcibly disconnect the client (which will return PAM_SYSTEM_ERR to the client).
* Fixed timeout handling in respondersJan Zeleny2011-10-141-72/+72
|
* Check if dp_requests hash table exists before using itJakub Hrozek2011-10-131-0/+5
|
* Use explicit base 10 for converting strings to integersJakub Hrozek2011-10-031-2/+2
| | | | https://fedorahosted.org/sssd/ticket/1013
* Do not delete requests inside hash_iterate loopJakub Hrozek2011-08-151-10/+12
|
* Converge accept_fd_handler and accept_priv_fd_handlerStephen Gallagher2011-07-291-85/+50
| | | | | These two functions were almost identical. Better to maintain them as a single function.
* Set _GNU_SOURCE globallySumit Bose2011-05-231-3/+1
|
* Allow changing the log level without restartStephen Gallagher2011-05-062-0/+15
| | | | | | We will now re-read the confdb debug_level value when processing the monitor_common_logrotate() function, which occurs when the monitor receives a SIGHUP.
* Create common sss_monitor_init()Stephen Gallagher2011-05-061-34/+3
| | | | | | | | This was implemented almost identically for both the responders and the providers. It is easier to maintain as a single routine. This patch also adds the ability to provide a private context to attach to the sbus_connection for later use.
* Add debug logging to the negative cacheStephen Gallagher2011-04-151-0/+5
|
* Update the ID cache for any PAM requestStephen Gallagher2010-12-221-0/+2
| | | | | | | | Also adds an option to limit how often we check the ID provider, so that conversations with multiple PAM requests won't update the cache multiple times. https://fedorahosted.org/sssd/ticket/749
* Fix unchecked return value in set_nonblockingStephen Gallagher2010-12-171-10/+53
| | | | | | Also fixes the same problem with set_close_on_exec https://fedorahosted.org/sssd/ticket/713
* Add a special filter type to handle enumerationsSumit Bose2010-12-021-1/+1
|
* Fix double free issueSumit Bose2010-10-261-2/+2
|
* Remove all nss requests after a reconnectSumit Bose2010-10-262-0/+21
| | | | | | | Currently we do not handle the open nss request after a reconnect and wait until they timeout (which is a couple of minutes!). This patch adds a handler that terminates all requests after a reconnect. Then responder will return matching cache entries or nothing.
* Add netgroup support to the NSS responderStephen Gallagher2010-10-132-0/+7
|
* Add negative cache features for netgroupsStephen Gallagher2010-10-132-0/+39
|
* Handle multiple simultaneous enumeration requestsStephen Gallagher2010-09-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if a second enumeration request arrived while one was already being processed, each process would receive only a subset of the total number of available users or groups. This is because we were maintaining the response object as a global value in the NSS responder. The second request would come in, see that the data set was already populated, and start reading from wherever the cursor was currently pointed. With this patch, we now move the cursor to the client context instead of the global NSS context. Additionally, this patch completely rewrites the approach to enumerations in the tevent_req style. This makes it much easier to follow in the code. In order to ensure that a slow or malicious client cannot hold onto a reference for the setent result object indefinitely, we set an expiration on the object. We use the enum_cache_timeout here, since that is an appropriate value. If the timeout fires during the normal operation of the get*ent() loop of a client program, we will save the current values of the read index so that we can resume as soon as the object has been refreshed by an implicit setent call. Instead of deleting the enumeration result object immediately after the last in-progress client has read it, we'll keep the object around for the lifetime of enum_cache_timeout. This way, additional clients making enumeration requests can still access the results in-memory.
* Dead assignments cleanup in NSS responderJan Zeleny2010-09-081-2/+0
| | | | | | Various dead assignments were deleted, some return value inspections were added. Ticket: #588
* Move setup of filter_users and filter_groups to negcache.cStephen Gallagher2010-06-172-0/+215
| | | | | Creates a new function - sss_ncache_prepopulate() - that can be shared with other responders, such as PAM.
* Refactor the negative cacheStephen Gallagher2010-06-172-0/+372
| | | | | Rename functions from nss_ncache_* to sss_ncache_* Move negative cache to responder/common and rename as negcache.c/h
* Properly null-terminate socket pathStephen Gallagher2010-06-141-2/+4
| | | | https://fedorahosted.org/sssd/ticket/540
* Check the correct variable for NULL after creating timerStephen Gallagher2010-06-101-1/+1
| | | | | | | | | In several places, we were creating a new timer and assigning it to the tev variable, but then we were checking for NULL from the te variable (which, incidentally, is guaranteed never to be NULL in this situation) https://fedorahosted.org/sssd/ticket/523
* Use SO_PEERCRED on the PAM socketSumit Bose2010-04-162-1/+55
| | | | | | | | | | | | | | | | | This is the second attempt to let the PAM client and the PAM responder exchange their credentials, i.e. uid, gid and pid. Because this approach does not require any message interchange between the client and the server the protocol version number is not changed. On the client side the connection is terminated it the responder is not run by root. On the server side the effective uid and gid and the pid of the client are available for future use. The following additional changes are made by this patch: - the checks of the ownership and the permissions on the PAM sockets are enhanced - internal error codes are introduced on the client side to generate more specific log messages if an error occurs
* Revert "Add better checks on PAM socket"Sumit Bose2010-04-162-140/+1
| | | | This reverts commit 5a88e963744e5da453e88b5c36499f04712df097.
* sysydb: Finally stop using a common event contextSimo Sorce2010-04-121-1/+1
| | | | This commit completes the migration to a synchronous sysdb
* Fix a series of memory leaks in the SBUSStephen Gallagher2010-03-171-4/+1
|