chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemctl: short cut things if we aren't root and the user requested a reboot to...
[elogind.git]
/
src
/
initctl.c
diff --git
a/src/initctl.c
b/src/initctl.c
index 3de7fcd42e89242b6dd1de24161bc6e91396ccde..7241acb8dfe59771c9d5c930eeb1aeaecbaccc2e 100644
(file)
--- a/
src/initctl.c
+++ b/
src/initctl.c
@@
-41,6
+41,7
@@
#include "initreq.h"
#include "special.h"
#include "sd-daemon.h"
#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))
#define SERVER_FD_MAX 16
#define TIMEOUT ((int) (10*MSEC_PER_SEC))
@@
-290,7
+291,7
@@
static int server_init(Server *s, unsigned n_sockets) {
goto fail;
}
goto fail;
}
- f->fd =
SD_LISTEN_FDS_START+i
;
+ f->fd =
fd
;
LIST_PREPEND(Fifo, fifo, s->fifos, f);
f->server = s;
s->n_fifos ++;
LIST_PREPEND(Fifo, fifo, s->fifos, f);
f->server = s;
s->n_fifos ++;
@@
-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;
}
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;
return 0;