X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmanager.c;h=2bc105843692f7b1c2e7ce3044f055dbeebc3995;hb=609c3029076da1ba423673161e5d0fc82ccca6b6;hp=ef1e3eac5fba78e20d3f5127b3bb4c3098689e5d;hpb=0aa281df2c5f56623abddf25d6bcdb82b641aeb2;p=elogind.git diff --git a/src/core/manager.c b/src/core/manager.c index ef1e3eac5..2bc105843 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -79,9 +79,6 @@ #include "bus-kernel.h" #include "time-util.h" -/* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */ -#define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC) - /* Initial delay and the interval for printing status messages about running jobs */ #define JOBS_IN_PROGRESS_WAIT_USEC (5*USEC_PER_SEC) #define JOBS_IN_PROGRESS_PERIOD_USEC (USEC_PER_SEC / 3) @@ -396,9 +393,6 @@ static int manager_setup_signals(Manager *m) { assert(m); - if (m->test_run) - return 0; - assert_se(sigaction(SIGCHLD, &sa, NULL) == 0); /* We make liberal use of realtime signals here. On @@ -678,25 +672,14 @@ static int manager_setup_notify(Manager *m) { if (!m->notify_socket) return log_oom(); + (void) mkdir_parents_label(m->notify_socket, 0755); + (void) unlink(m->notify_socket); + strncpy(sa.un.sun_path, m->notify_socket, sizeof(sa.un.sun_path)-1); r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)); if (r < 0) { log_error("bind(%s) failed: %m", sa.un.sun_path); - if (errno == EADDRINUSE) { - log_notice("Removing %s socket and trying again.", m->notify_socket); - r = unlink(m->notify_socket); - if (r < 0) { - log_error("Failed to remove %s: %m", m->notify_socket); - return -EADDRINUSE; - } - - r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)); - if (r < 0) { - log_error("bind(%s) failed: %m", sa.un.sun_path); - return -errno; - } - } else - return -errno; + return -errno; } r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)); @@ -746,13 +729,6 @@ static int manager_setup_kdbus(Manager *m) { } log_debug("Successfully set up kdbus on %s", p); - - /* Create the namespace directory here, so that the contents - * of that directory is not visible to non-root users. This is - * necessary to ensure that users cannot get access to busses - * of virtualized users when no UID namespacing is used. */ - if (m->running_as == SYSTEMD_SYSTEM) - mkdir_p_label("/dev/kdbus/domain", 0700); #endif return 0;