summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-01-08 11:49:43 -0500
committerSimo Sorce <idra@samba.org>2009-01-09 14:23:44 -0500
commit05ab26fa32d364c71b582d5bb72b5305b2554ef6 (patch)
tree18a7aa9218d6863dfa4199cd140edcb43147ac01 /server
parent37f6b1a70e5ca702e2081283755c4b9dd9a4b799 (diff)
downloadsssd-05ab26fa32d364c71b582d5bb72b5305b2554ef6.tar.gz
sssd-05ab26fa32d364c71b582d5bb72b5305b2554ef6.tar.xz
sssd-05ab26fa32d364c71b582d5bb72b5305b2554ef6.zip
If exec() returns in start_service (for example, if the command contains a typo and therefore doesn't exist), we cannot call exit() due to a bug in D-BUS. We will replace this with _exit() and also print out the nature of the error that caused exec() to return.
Diffstat (limited to 'server')
-rw-r--r--server/monitor.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/server/monitor.c b/server/monitor.c
index bddc0d488..18fb3255b 100644
--- a/server/monitor.c
+++ b/server/monitor.c
@@ -401,7 +401,7 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
if (svc->command == NULL) {
/* the LOCAL domain does not need a backend at the moment */
if (strcasecmp(doms[i], "LOCAL") != 0) {
- DEBUG(0, ("Missing command to run provider [%s]\n"));
+ DEBUG(0, ("Missing command to run provider\n"));
}
talloc_free(svc);
continue;
@@ -884,7 +884,15 @@ static int start_service(const char *name, const char *command, pid_t *retpid)
args = parse_args(command);
execvp(args[0], args);
- exit(1);
+
+ /* If we are here, exec() has failed
+ * Print errno and abort quickly */
+ DEBUG(0,("Could not exec %s, reason: %s\n", command, strerror(errno)));
+
+ /* We have to call _exit() instead of exit() here
+ * because a bug in D-BUS will cause the server to
+ * close its socket at exit() */
+ _exit(1);
}
int main(int argc, const char *argv[])