diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-03-31 16:46:21 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-03-31 16:46:21 +0200 |
commit | 98178d3947d951ca001eaf400b5f362f458dceb5 (patch) | |
tree | a4345b294f68d22bd3eb84ca066420652e767d2f /src/libsystemd-bus/bus-socket.c | |
parent | 52f3ba915bdce4d7476c3ea53b8371deff5f567d (diff) |
bus: rename sd_bus_get_peer() to sd_bus_get_server_id()
This function always returns the server side ID. The name suggested it
was actually always the peer's ID, but that's not correct if the call is
called on a server bus context. Hence, let's correct the name a bit.
Diffstat (limited to 'src/libsystemd-bus/bus-socket.c')
-rw-r--r-- | src/libsystemd-bus/bus-socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd-bus/bus-socket.c b/src/libsystemd-bus/bus-socket.c index cb1e942833..fed1971ec7 100644 --- a/src/libsystemd-bus/bus-socket.c +++ b/src/libsystemd-bus/bus-socket.c @@ -146,11 +146,11 @@ static int bus_socket_auth_verify_client(sd_bus *b) { peer.bytes[i/2] = ((uint8_t) x << 4 | (uint8_t) y); } - if (!sd_id128_equal(b->peer, SD_ID128_NULL) && - !sd_id128_equal(b->peer, peer)) + if (!sd_id128_equal(b->server_id, SD_ID128_NULL) && + !sd_id128_equal(b->server_id, peer)) return -EPERM; - b->peer = peer; + b->server_id = peer; /* And possibly check the second line, too */ @@ -286,7 +286,7 @@ static int bus_socket_auth_write_ok(sd_bus *b) { assert(b); - snprintf(t, sizeof(t), "OK " SD_ID128_FORMAT_STR "\r\n", SD_ID128_FORMAT_VAL(b->peer)); + snprintf(t, sizeof(t), "OK " SD_ID128_FORMAT_STR "\r\n", SD_ID128_FORMAT_VAL(b->server_id)); char_array_0(t); return bus_socket_auth_write(b, t); |