summaryrefslogtreecommitdiff
path: root/src/shared/logs-show.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-17 01:03:09 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-17 01:05:37 +0100
commita4475f577bd0daf762d6c3b4e58bc484e0cb74af (patch)
tree5dca2abf91be82c72179b9f0ba745d32d4fdc85f /src/shared/logs-show.c
parentd003f514dab2dbf1a66e11800a50aeaf039d036c (diff)
bus: when entering an existing namespace to connect to a container's system bus also switch over PID namespace
This is necessary to ensure that kdbus can collect creds of the destination namespace when connecting.
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r--src/shared/logs-show.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index b24bce50c0..0f27c4ee41 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -1117,7 +1117,7 @@ int add_matches_for_user_unit(sd_journal *j, const char *unit, uid_t uid) {
static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
_cleanup_close_pipe_ int pair[2] = { -1, -1 };
- _cleanup_close_ int nsfd = -1, rootfd = -1;
+ _cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1;
pid_t pid, child;
siginfo_t si;
char buf[37];
@@ -1134,7 +1134,7 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
if (r < 0)
return r;
- r = namespace_open(pid, &nsfd, &rootfd);
+ r = namespace_open(pid, &pidnsfd, &mntnsfd, &rootfd);
if (r < 0)
return r;
@@ -1151,7 +1151,7 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
close_nointr_nofail(pair[0]);
pair[0] = -1;
- r = namespace_enter(nsfd, rootfd);
+ r = namespace_enter(pidnsfd, mntnsfd, rootfd);
if (r < 0)
_exit(EXIT_FAILURE);