1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

initctl: check peer credentials after connection

This commit is contained in:
Lennart Poettering 2010-07-07 03:48:37 +02:00
parent f4579ce704
commit a822056bca
2 changed files with 7 additions and 1 deletions

View File

@ -453,7 +453,8 @@ systemd_logger_LDADD = \
systemd_initctl_SOURCES = \
src/initctl.c \
src/sd-daemon.c
src/sd-daemon.c \
src/dbus-common.c
systemd_initctl_CFLAGS = \
$(AM_CFLAGS) \

View File

@ -41,6 +41,7 @@
#include "initreq.h"
#include "special.h"
#include "sd-daemon.h"
#include "dbus-common.h"
#define SERVER_FD_MAX 16
#define TIMEOUT ((int) (10*MSEC_PER_SEC))
@ -300,6 +301,10 @@ static int server_init(Server *s, unsigned n_sockets) {
log_error("Failed to get D-Bus connection: %s", error.message);
goto fail;
}
if ((r = bus_check_peercred(s->bus)) < 0) {
log_error("Bus connection failed peer credential check: %s", strerror(-r));
goto fail;
}
return 0;