Skip to content

Commit

Permalink
Treat the local provider as a special case
Browse files Browse the repository at this point in the history
The local provider needs no backend, so we'll create a special
provider entry for it called "local" that will not attempt to
retrieve provider configuration but will remain in the service
list so it can be updated when the config file changes.
  • Loading branch information
sgallagher authored and simo5 committed May 15, 2009
1 parent 67ce05e commit d6b65c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/examples/sssd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ description = Domains served by SSSD

; [domains/LOCAL]
; description = LOCAL Users domain
; provider = local
; enumerate = 3
; minId = 500
; maxId = 999
Expand Down
17 changes: 16 additions & 1 deletion server/monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,11 @@ static int service_signal_reload(struct mt_svc *svc)
DBusConnection *conn;
DBusPendingCall *pending_reply;

if (svc->provider && strcasecmp(svc->provider, "local") == 0) {
/* The local provider requires no signaling */
return EOK;
}

conn = sbus_get_connection(svc->mt_conn->conn_ctx);
msg = dbus_message_new_method_call(NULL,
SERVICE_PATH,
Expand Down Expand Up @@ -954,7 +959,7 @@ static int update_monitor_config(struct mt_ctx *ctx)
cur_svc = cur_svc->next;
}
if (cur_svc == NULL) {
DEBUG(0, ("Service entry missing data\n"));
DEBUG(0, ("Service entry missing data for [%s]\n", new_dom->name));
/* This shouldn't be possible
*/
talloc_free(new_config);
Expand Down Expand Up @@ -1911,6 +1916,16 @@ static void service_startup_handler(struct tevent_context *ev,
return;
}

if (mt_svc->provider && strcasecmp(mt_svc->provider, "local") == 0) {
/* The LOCAL provider requires no back-end currently
* We'll add it to the service list, but we don't need
* to poll it.
*/
DLIST_ADD(mt_svc->mt_ctx->svc_list, mt_svc);
talloc_set_destructor((TALLOC_CTX *)mt_svc, delist_service);
return;
}

mt_svc->pid = fork();
if (mt_svc->pid != 0) {
if (mt_svc->pid == -1) {
Expand Down

0 comments on commit d6b65c3

Please sign in to comment.