chiark / gitweb /
build-sys: allow lto and FORTIFY_SOURCE with -O[sz]
[elogind.git] / src / bus-proxyd / stdio-bridge.c
index c17047b7e9f9878b033a900ef766c3f4df73613e..35e69a5c01276fb801a43a05a7c4f3393d344fc1 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/poll.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 char *arg_address = NULL;
 static char *arg_command_line_buffer = NULL;
@@ -174,11 +160,11 @@ static int rename_service(sd_bus *a, sd_bus *b) {
         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);
+        r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_EUID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM|SD_BUS_CREDS_AUGMENT, &creds);
         if (r < 0)
                 return r;
 
-        r = sd_bus_creds_get_uid(creds, &uid);
+        r = sd_bus_creds_get_euid(creds, &uid);
         if (r < 0)
                 return r;
 
@@ -246,7 +232,7 @@ int main(int argc, char *argv[]) {
         if (r < 0)
                 goto finish;
 
-        r = rename_service(p->dest_bus, p->local_bus);
+        r = rename_service(p->destination_bus, p->local_bus);
         if (r < 0)
                 log_debug_errno(r, "Failed to rename process: %m");