bus-proxyd.c revision c0395aeb903cde25bd9e81fba3334f63335fe0ef
along with systemd; If not, see <http://www.gnu.org/licenses/>.
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stddef.h>
#include <getopt.h>
#include "log.h"
#include "util.h"
#include "socket-util.h"
#include "sd-daemon.h"
#include "sd-bus.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-util.h"
#include "build.h"
#include "strv.h"
#include "def.h"
#include "capability.h"
#include "bus-control.h"
#include "smack-util.h"
#include "set.h"
#include "bus-xml-policy.h"
#include "driver.h"
#include "proxy.h"
#include "synthesize.h"
static bool arg_drop_privileges = false;
static int help(void) {
help();
case ARG_VERSION:
case ARG_ADDRESS: {
return log_oom();
arg_address = a;
case ARG_DROP_PRIVILEGES:
arg_drop_privileges = true;
case ARG_CONFIGURATION:
return log_oom();
case ARG_MACHINE: {
return log_oom();
#ifdef ENABLE_KDBUS
return log_oom();
arg_address = a;
return -EINVAL;
return -EINVAL;
if (!arg_address) {
if (!arg_address)
return log_oom();
const char *comm;
char **cmdline;
assert(a);
assert(b);
r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM|SD_BUS_CREDS_AUGMENT, &creds);
if (!name)
return -ENOMEM;
return -ENOMEM;
sd_notifyf(false,
pid, p,
if (arg_command_line_buffer) {
size_t m, w;
pid, p,
a->unique_name);
log_open();
goto finish;
r = sd_listen_fds(0);
goto finish;
if (arg_drop_privileges) {
goto finish;
goto finish;
goto finish;
goto finish;
goto finish;
r = proxy_run(p);
sd_notify(false,