summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2014-10-22 19:17:24 +0200
committerDaniel Mack <daniel@zonque.org>2014-10-22 19:45:07 +0200
commit056f95d0a70413e10e4a4ea9966baabb5a1450ed (patch)
treed712969f6e7d7352dfe41210edcfce5187ef81e5
parent370d7a9c0fe558c5846a2abd919e397639b69506 (diff)
sd-bus: rename sd_bus_get_owner_uid(), sd_bus_get_owner_machine_id() and sd_bus_get_peer_creds()
Clean up the function namespace by renaming the following: sd_bus_get_owner_uid() → sd_bus_get_name_creds_uid() sd_bus_get_owner_machine_id() → sd_bus_get_name_machine_id() sd_bus_get_peer_creds() → sd_bus_get_owner_creds()
-rw-r--r--man/sd_bus_creds_get_pid.xml4
-rw-r--r--src/bus-proxyd/bus-proxyd.c10
-rw-r--r--src/core/service.c2
-rw-r--r--src/libsystemd/libsystemd.sym.m46
-rw-r--r--src/libsystemd/sd-bus/bus-control.c12
-rw-r--r--src/libsystemd/sd-bus/bus-convenience.c4
-rw-r--r--src/libsystemd/sd-bus/bus-track.c2
-rw-r--r--src/libsystemd/sd-bus/busctl.c6
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c2
-rw-r--r--src/systemd/sd-bus.h6
10 files changed, 27 insertions, 27 deletions
diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml
index cc8603cacc..23763bd6ae 100644
--- a/man/sd_bus_creds_get_pid.xml
+++ b/man/sd_bus_creds_get_pid.xml
@@ -237,7 +237,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<citerefentry><refentrytitle>sd_bus_creds_new_from_pid</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
in which case it will describe the specified process, or it may be
created by
- <citerefentry><refentrytitle>sd_bus_get_peer_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+ <citerefentry><refentrytitle>sd_bus_get_owner_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
in which case it will describe the process at the other endpoint
of a connection.
</para>
@@ -410,7 +410,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
<function>sd_bus_get_user_unit()</function>,
<function>sd_bus_get_slice()</function>,
<function>sd_bus_get_session()</function>, and
- <function>sd_bus_get_owner_uid()</function> if the sender is not
+ <function>sd_bus_get_name_creds_uid()</function> if the sender is not
part of a systemd system unit, systemd user unit, systemd
slice, logind session, or a systemd user session.</para>
</listitem>
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index a9f64da57a..11d0e289cf 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -186,7 +186,7 @@ static int rename_service(sd_bus *a, sd_bus *b) {
assert(a);
assert(b);
- r = sd_bus_get_peer_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM, &creds);
+ r = sd_bus_get_owner_creds(b, SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_CMDLINE|SD_BUS_CREDS_COMM, &creds);
if (r < 0)
return r;
@@ -454,7 +454,7 @@ static int get_creds_by_name(sd_bus *bus, const char *name, uint64_t mask, sd_bu
assert_return(service_name_is_valid(name), -EINVAL);
- r = sd_bus_get_owner(bus, name, mask, &c);
+ r = sd_bus_get_name_creds(bus, name, mask, &c);
if (r == -ESRCH || r == -ENXIO)
return sd_bus_error_setf(error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Name %s is currently not owned by anyone.", name);
if (r < 0)
@@ -747,7 +747,7 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
if (!service_name_is_valid(arg0))
return synthetic_reply_method_errno(m, -EINVAL, NULL);
- r = sd_bus_get_owner(a, arg0, 0, NULL);
+ r = sd_bus_get_name_creds(a, arg0, 0, NULL);
if (r == -ESRCH || r == -ENXIO) {
sd_bus_error_setf(&error, SD_BUS_ERROR_NAME_HAS_NO_OWNER, "Could not get owners of name '%s': no such name.", arg0);
return synthetic_reply_method_errno(m, r, &error);
@@ -811,7 +811,7 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
if (streq(name, "org.freedesktop.DBus"))
return synthetic_reply_method_return(m, "b", true);
- r = sd_bus_get_owner(a, name, 0, NULL);
+ r = sd_bus_get_name_creds(a, name, 0, NULL);
if (r < 0 && r != -ESRCH && r != -ENXIO)
return synthetic_reply_method_errno(m, r, NULL);
@@ -895,7 +895,7 @@ static int process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m) {
if (flags != 0)
return synthetic_reply_method_errno(m, -EINVAL, NULL);
- r = sd_bus_get_owner(a, name, 0, NULL);
+ r = sd_bus_get_name_creds(a, name, 0, NULL);
if (r >= 0 || streq(name, "org.freedesktop.DBus"))
return synthetic_reply_method_return(m, "u", BUS_START_REPLY_ALREADY_RUNNING);
if (r != -ESRCH)
diff --git a/src/core/service.c b/src/core/service.c
index 76763441b0..d160c4e93b 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2729,7 +2729,7 @@ static void service_bus_name_owner_change(
/* Try to acquire PID from bus service */
- r = sd_bus_get_owner(u->manager->api_bus, name, SD_BUS_CREDS_PID, &creds);
+ r = sd_bus_get_name_creds(u->manager->api_bus, name, SD_BUS_CREDS_PID, &creds);
if (r >= 0)
r = sd_bus_creds_get_pid(creds, &pid);
if (r >= 0) {
diff --git a/src/libsystemd/libsystemd.sym.m4 b/src/libsystemd/libsystemd.sym.m4
index 87da7ac021..ab11448bb9 100644
--- a/src/libsystemd/libsystemd.sym.m4
+++ b/src/libsystemd/libsystemd.sym.m4
@@ -191,7 +191,7 @@ global:
sd_bus_is_open;
sd_bus_can_send;
sd_bus_get_server_id;
- sd_bus_get_peer_creds;
+ sd_bus_get_owner_creds;
sd_bus_get_name;
sd_bus_send;
sd_bus_send_to;
@@ -287,8 +287,8 @@ global:
sd_bus_request_name;
sd_bus_release_name;
sd_bus_list_names;
- sd_bus_get_owner;
- sd_bus_get_owner_machine_id;
+ sd_bus_get_name_creds;
+ sd_bus_get_name_machine_id;
sd_bus_call_method;
sd_bus_get_property;
sd_bus_get_property_trivial;
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index b66606763d..96f59f9b36 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -549,7 +549,7 @@ static int bus_populate_creds_from_items(sd_bus *bus,
return 0;
}
-static int bus_get_owner_kdbus(
+static int bus_get_name_creds_kdbus(
sd_bus *bus,
const char *name,
uint64_t mask,
@@ -627,7 +627,7 @@ fail:
return r;
}
-static int bus_get_owner_dbus1(
+static int bus_get_name_creds_dbus1(
sd_bus *bus,
const char *name,
uint64_t mask,
@@ -773,7 +773,7 @@ static int bus_get_owner_dbus1(
return 0;
}
-_public_ int sd_bus_get_owner(
+_public_ int sd_bus_get_name_creds(
sd_bus *bus,
const char *name,
uint64_t mask,
@@ -791,9 +791,9 @@ _public_ int sd_bus_get_owner(
return -ENOTCONN;
if (bus->is_kernel)
- return bus_get_owner_kdbus(bus, name, mask, creds);
+ return bus_get_name_creds_kdbus(bus, name, mask, creds);
else
- return bus_get_owner_dbus1(bus, name, mask, creds);
+ return bus_get_name_creds_dbus1(bus, name, mask, creds);
}
static int add_name_change_match(sd_bus *bus,
@@ -1245,7 +1245,7 @@ int bus_remove_match_internal(
return bus_remove_match_internal_dbus1(bus, match);
}
-_public_ int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine) {
+_public_ int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine) {
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL, *m = NULL;
const char *mid;
int r;
diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c
index f88836b884..8081a2f9c0 100644
--- a/src/libsystemd/sd-bus/bus-convenience.c
+++ b/src/libsystemd/sd-bus/bus-convenience.c
@@ -465,9 +465,9 @@ _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_b
* to get it from the sender or peer */
if (call->sender)
- return sd_bus_get_owner(call->bus, call->sender, mask, creds);
+ return sd_bus_get_name_creds(call->bus, call->sender, mask, creds);
else
- return sd_bus_get_peer_creds(call->bus, mask, creds);
+ return sd_bus_get_owner_creds(call->bus, mask, creds);
}
return bus_creds_extend_by_pid(c, mask, creds);
diff --git a/src/libsystemd/sd-bus/bus-track.c b/src/libsystemd/sd-bus/bus-track.c
index 4b6a8bfee9..f3b593d2b8 100644
--- a/src/libsystemd/sd-bus/bus-track.c
+++ b/src/libsystemd/sd-bus/bus-track.c
@@ -188,7 +188,7 @@ _public_ int sd_bus_track_add_name(sd_bus_track *track, const char *name) {
/* Second, check if it is currently existing, or maybe
* doesn't, or maybe disappeared already. */
- r = sd_bus_get_owner(track->bus, n, 0, NULL);
+ r = sd_bus_get_name_creds(track->bus, n, 0, NULL);
if (r < 0) {
hashmap_remove(track->names, n);
return r;
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index f06b74505b..fdc275ce46 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -142,7 +142,7 @@ static int list_bus_names(sd_bus *bus, char **argv) {
printf("%-*s", (int) max_i, *i);
- r = sd_bus_get_owner(bus, *i,
+ r = sd_bus_get_name_creds(bus, *i,
SD_BUS_CREDS_UID|SD_BUS_CREDS_PID|SD_BUS_CREDS_COMM|
SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_SESSION|
SD_BUS_CREDS_CONNECTION_NAME, &creds);
@@ -210,7 +210,7 @@ static int list_bus_names(sd_bus *bus, char **argv) {
printf(" - - - - - - - ");
if (arg_show_machine) {
- r = sd_bus_get_owner_machine_id(bus, *i, &mid);
+ r = sd_bus_get_name_machine_id(bus, *i, &mid);
if (r >= 0) {
char m[SD_ID128_STRING_MAX];
printf(" %s\n", sd_id128_to_string(mid, m));
@@ -306,7 +306,7 @@ static int status(sd_bus *bus, char *argv[]) {
r = parse_pid(argv[1], &pid);
if (r < 0)
- r = sd_bus_get_owner(bus, argv[1], _SD_BUS_CREDS_ALL, &creds);
+ r = sd_bus_get_name_creds(bus, argv[1], _SD_BUS_CREDS_ALL, &creds);
else
r = sd_bus_creds_new_from_pid(&creds, pid, _SD_BUS_CREDS_ALL);
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 549f9e0943..9ec15658df 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -3300,7 +3300,7 @@ _public_ int sd_bus_path_decode(const char *path, const char *prefix, char **ext
return 1;
}
-_public_ int sd_bus_get_peer_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
+_public_ int sd_bus_get_owner_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
sd_bus_creds *c;
pid_t pid = 0;
int r;
diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
index 9d13e94821..18acfc2ad7 100644
--- a/src/systemd/sd-bus.h
+++ b/src/systemd/sd-bus.h
@@ -131,7 +131,7 @@ sd_bus *sd_bus_unref(sd_bus *bus);
int sd_bus_is_open(sd_bus *bus);
int sd_bus_can_send(sd_bus *bus, char type);
int sd_bus_get_server_id(sd_bus *bus, sd_id128_t *peer);
-int sd_bus_get_peer_creds(sd_bus *bus, uint64_t creds_mask, sd_bus_creds **ret);
+int sd_bus_get_owner_creds(sd_bus *bus, uint64_t creds_mask, sd_bus_creds **ret);
int sd_bus_get_name(sd_bus *bus, const char **name);
int sd_bus_get_tid(sd_bus *bus, pid_t *tid);
@@ -260,8 +260,8 @@ int sd_bus_get_unique_name(sd_bus *bus, const char **unique);
int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags);
int sd_bus_release_name(sd_bus *bus, const char *name);
int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable); /* free the results */
-int sd_bus_get_owner(sd_bus *bus, const char *name, uint64_t mask, sd_bus_creds **creds); /* unref the result! */
-int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine);
+int sd_bus_get_name_creds(sd_bus *bus, const char *name, uint64_t mask, sd_bus_creds **creds); /* unref the result! */
+int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine);
/* Convenience calls */