chiark / gitweb /
sd-bus: rename default bus address constants, they aren't "paths" but "addresses"
authorLennart Poettering <lennart@poettering.net>
Fri, 28 Nov 2014 15:05:43 +0000 (16:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 28 Nov 2014 15:17:33 +0000 (16:17 +0100)
src/bus-proxyd/bus-proxyd.c
src/dbus1-generator/dbus1-generator.c
src/libsystemd/sd-bus/bus-util.c
src/libsystemd/sd-bus/sd-bus.c
src/login/pam_systemd.c
src/shared/def.h

index 45061ad..a66197a 100644 (file)
@@ -61,7 +61,7 @@ static int help(void) {
                "     --configuration=PATH Configuration file or directory\n"
                "     --machine=MACHINE    Connect to specified machine\n"
                "     --address=ADDRESS    Connect to the bus specified by ADDRESS\n"
-               "                          (default: " DEFAULT_SYSTEM_BUS_PATH ")\n",
+               "                          (default: " DEFAULT_SYSTEM_BUS_ADDRESS ")\n",
                program_invocation_short_name);
 
         return 0;
@@ -166,7 +166,7 @@ static int parse_argv(int argc, char *argv[]) {
         }
 
         if (!arg_address) {
-                arg_address = strdup(DEFAULT_SYSTEM_BUS_PATH);
+                arg_address = strdup(DEFAULT_SYSTEM_BUS_ADDRESS);
                 if (!arg_address)
                         return log_oom();
         }
index a459c84..5d3b1a8 100644 (file)
@@ -86,7 +86,7 @@ static int create_dbus_files(
                         fprintf(f, "Environment=DBUS_STARTER_BUS_TYPE=%s\n", type);
 
                         if (streq(type, "system"))
-                                fprintf(f, "Environment=DBUS_STARTER_ADDRESS=" DEFAULT_SYSTEM_BUS_PATH "\n");
+                                fprintf(f, "Environment=DBUS_STARTER_ADDRESS=" DEFAULT_SYSTEM_BUS_ADDRESS "\n");
                         else if (streq(type, "session")) {
                                 char *run;
 
@@ -96,7 +96,7 @@ static int create_dbus_files(
                                         return -EINVAL;
                                 }
 
-                                fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT "\n",
+                                fprintf(f, "Environment=DBUS_STARTER_ADDRESS="KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT "\n",
                                         getuid(), run);
                         }
                 }
index 22a3766..9fcbfcc 100644 (file)
@@ -521,7 +521,7 @@ int bus_open_system_systemd(sd_bus **_bus) {
         if (r < 0)
                 return r;
 
-        r = sd_bus_set_address(bus, KERNEL_SYSTEM_BUS_PATH);
+        r = sd_bus_set_address(bus, KERNEL_SYSTEM_BUS_ADDRESS);
         if (r < 0)
                 return r;
 
@@ -574,7 +574,7 @@ int bus_open_user_systemd(sd_bus **_bus) {
         if (r < 0)
                 return r;
 
-        if (asprintf(&bus->address, KERNEL_USER_BUS_FMT, getuid()) < 0)
+        if (asprintf(&bus->address, KERNEL_USER_BUS_ADDRESS_FMT, getuid()) < 0)
                 return -ENOMEM;
 
         bus->bus_client = true;
index 9ce6bfa..70dabcc 100644 (file)
@@ -1119,7 +1119,7 @@ int bus_set_address_system(sd_bus *b) {
         if (e)
                 return sd_bus_set_address(b, e);
 
-        return sd_bus_set_address(b, DEFAULT_SYSTEM_BUS_PATH);
+        return sd_bus_set_address(b, DEFAULT_SYSTEM_BUS_ADDRESS);
 }
 
 _public_ int sd_bus_open_system(sd_bus **ret) {
@@ -1175,13 +1175,13 @@ int bus_set_address_user(sd_bus *b) {
                         return -ENOMEM;
 
 #ifdef ENABLE_KDBUS
-                (void) asprintf(&b->address, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT, getuid(), ee);
+                (void) asprintf(&b->address, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, getuid(), ee);
 #else
-                (void) asprintf(&b->address, UNIX_USER_BUS_FMT, ee);
+                (void) asprintf(&b->address, UNIX_USER_BUS_ADDRESS_FMT, ee);
 #endif
         } else {
 #ifdef ENABLE_KDBUS
-                (void) asprintf(&b->address, KERNEL_USER_BUS_FMT, getuid());
+                (void) asprintf(&b->address, KERNEL_USER_BUS_ADDRESS_FMT, getuid());
 #else
                 return -ECONNREFUSED;
 #endif
index 4974c51..111e2b7 100644 (file)
@@ -183,8 +183,7 @@ static int export_legacy_dbus_address(
         if (access("/sys/fs/kdbus", F_OK) < 0)
                 return PAM_SUCCESS;
 
-        if (asprintf(&s, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT,
-                     uid, runtime) < 0) {
+        if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) {
                 pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
                 return PAM_BUF_ERR;
         }
index 98e3e10..96c45a6 100644 (file)
         "/usr/lib/kbd/keymaps/\0"
 #endif
 
-#define UNIX_SYSTEM_BUS_PATH "unix:path=/var/run/dbus/system_bus_socket"
-#define KERNEL_SYSTEM_BUS_PATH "kernel:path=/sys/fs/kdbus/0-system/bus"
+#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
+#define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
 
 #ifdef ENABLE_KDBUS
-#  define DEFAULT_SYSTEM_BUS_PATH KERNEL_SYSTEM_BUS_PATH ";" UNIX_SYSTEM_BUS_PATH
+#  define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
 #else
-#  define DEFAULT_SYSTEM_BUS_PATH UNIX_SYSTEM_BUS_PATH
+#  define DEFAULT_SYSTEM_BUS_ADDRESS UNIX_SYSTEM_BUS_ADDRESS
 #endif
 
-#define UNIX_USER_BUS_FMT "unix:path=%s/bus"
-#define KERNEL_USER_BUS_FMT "kernel:path=/sys/fs/kdbus/"UID_FMT"-user/bus"
+#define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
+#define KERNEL_USER_BUS_ADDRESS_FMT "kernel:path=/sys/fs/kdbus/"UID_FMT"-user/bus"
 
 #define PLYMOUTH_SOCKET {                                       \
                 .un.sun_family = AF_UNIX,                       \