connection: remove duplicate variable declaration
metadata: reflect change in task_cgroup_name

Change: e61734c55c24cdf11b07e52a74aec4dc4a7f4bd0.
Merged: dc5ed40686a4da95881c35d913b60f867755cbe2 in 3.15-rc1.

task_cgroup_name returns a pointer to the path or NULL if there is not
enough space in the buffer (used to return nonnegative or
-ENAMETOOLONG).

On systemd systems fixes a kernel panic about init dying while opening a
bus. Now it boots properly.
connection: return ESRCH for unknown names consistently

We use ESRCH for unknown names except in GET_CONN_INFO. That's misleading
and makes error forwarding error prone. Fix that and use ESRCH instead of
ENOENT.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
connection: dont modify msg in case of errors in kdbus_conn_get_conn_dst

We shouldn't modify the message before we decided whether to fail or not.
Keep the name-id local and write it only after we checked for all errors.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
names: fix kdbus_name_lookup() race condition

We cannot return pointers to the internal name registry from
kdbus_name_lookup(). No-one guarantees that these entries will stay valid.
Therefore, return the requested information directly with proper
references. This is protected by locks in kdbus_name_lookup() itself and
thus is safe.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
names: fix kdbus_name_lookup() to not ref NULL conns (ABI break)

The previous kdbus_name_lookup() fix assumed kdbus_conn_ref(NULL) is a
no-op. Turns out, it's a panic-op instead... Fix it.

Also add the ABI-break annotation as the previous error-code change
requires new systemd user-space (fixed by Kay).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>