metadata: add back code to fill creds data
authorDaniel Mack <zonque@gmail.com>
Tue, 19 Aug 2014 17:04:42 +0000 (19:04 +0200)
committerDaniel Mack <zonque@gmail.com>
Tue, 19 Aug 2014 17:04:42 +0000 (19:04 +0200)
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.

metadata.c

index 3dff9ac36013e815262d575d3e30a9f18e4f6d6e..934aa626bd47c92b6cfc1b72ef773f3c6491e047 100644 (file)
@@ -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,