Commit 6f79c579 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

main: remove AF_UNIX sockets before binding

parent f41de959
......@@ -955,6 +955,7 @@ static int bus_init_private(Manager *m) {
if (getpid() != 1)
return 0;
unlink("/dev/.run/systemd/private");
if (!(m->private_bus = dbus_server_listen("unix:path=/dev/.run/systemd/private", &error))) {
log_error("Failed to create private D-Bus server: %s", error.message);
r = -EIO;
......
......@@ -90,8 +90,10 @@ static int manager_setup_notify(Manager *m) {
if (getpid() != 1)
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path), NOTIFY_SOCKET_USER "/%llu", random_ull());
else
else {
unlink(NOTIFY_SOCKET_SYSTEM);
strncpy(sa.un.sun_path, NOTIFY_SOCKET_SYSTEM, sizeof(sa.un.sun_path));
}
if (sa.un.sun_path[0] == '@')
sa.un.sun_path[0] = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment