summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2014-08-19 19:04:42 +0200
committerDaniel Mack <zonque@gmail.com>2014-08-19 19:04:42 +0200
commit7bde48f293f5207ba5820c80bd473012aa453ba0 (patch)
treeda2a999f6174a2f50a781e1787b72dcfb83873cd
parentafb737db68c8a9a46db3034f888250b1ce11f61d (diff)
downloadkdbus-bus-7bde48f293f5207ba5820c80bd473012aa453ba0.tar.gz
kdbus-bus-7bde48f293f5207ba5820c80bd473012aa453ba0.tar.bz2
kdbus-bus-7bde48f293f5207ba5820c80bd473012aa453ba0.zip
metadata: add back code to fill creds data
It was overlooked that metadata is also used for connection info calls. Until we find a nicer way, just do the creds assigment in this item twice: once at metadata creation time, and again when we deliver the message.
-rw-r--r--metadata.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/metadata.c b/metadata.c
index 3dff9ac3601..934aa626bd4 100644
--- a/metadata.c
+++ b/metadata.c
@@ -187,7 +187,14 @@ static int kdbus_meta_append_cred(struct kdbus_meta *meta)
{
struct kdbus_creds creds = {};
- /* uid, gid, pid and tid will be filled later */
+ /*
+ * uid, gid, pid and tid will be patched over again at message
+ * install time.
+ */
+ creds.uid = from_kuid_munged(current_user_ns(), current_uid());
+ creds.gid = from_kgid_munged(current_user_ns(), current_gid());
+ creds.pid = task_pid_vnr(current);
+ creds.tid = task_tgid_vnr(current);
creds.starttime = current->start_time;
return kdbus_meta_append_data(meta, KDBUS_ITEM_CREDS,