bus-container.c revision b6741478e7661c7e580e5dcfd6a6fccd1899c1d0
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
Copyright 2013 Lennart Poettering
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <unistd.h>
#include <fcntl.h>
#include "util.h"
#include "fileio.h"
#include "bus-internal.h"
#include "bus-socket.h"
#include "bus-container.h"
int bus_container_connect(sd_bus *b) {
char *p;
int r;
assert(b);
if (r == -ENOENT)
return -EHOSTDOWN;
if (r < 0)
return r;
if (!s)
return -EIO;
return -EIO;
if (r < 0)
return r;
if (leader <= 1)
return -EIO;
if (r < 0)
return -ENOMEM;
if (nsfd < 0)
return -errno;
if (r < 0)
return -ENOMEM;
if (rootfd < 0)
return -errno;
if (b->input_fd < 0)
return -errno;
r = bus_socket_setup(b);
if (r < 0)
return r;
if (child < 0)
return -errno;
if (child == 0) {
if (r < 0)
_exit(255);
_exit(255);
if (chroot(".") < 0)
_exit(255);
if (r < 0) {
if (errno == EINPROGRESS)
_exit(1);
_exit(255);
}
_exit(0);
}
if (r < 0)
return r;
return -EIO;
return 1;
return -EIO;
return bus_socket_start_auth(b);
}