Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm Make DRM_IOCTL_GET_C...



details:   https://anonhg.NetBSD.org/src/rev/9463ab569503
branches:  riastradh-drm2
changeset: 788589:9463ab569503
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jan 15 13:52:20 2014 +0000

description:
Make DRM_IOCTL_GET_CLIENT work except for pid and uid.

The pid and uid don't make sense because the client is associated
with a file descriptor, which may be held by multiple processes, and
even if only one holds it (which is probably the only sensible state
of affairs), there's no index.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_ioctl.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r f507155fdb08 -r 9463ab569503 sys/external/bsd/drm2/dist/drm/drm_ioctl.c
--- a/sys/external/bsd/drm2/dist/drm/drm_ioctl.c        Wed Jan 15 13:52:09 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_ioctl.c        Wed Jan 15 13:52:20 2014 +0000
@@ -203,7 +203,6 @@
 int drm_getclient(struct drm_device *dev, void *data,
                  struct drm_file *file_priv)
 {
-#ifndef __NetBSD__             /* XXX Too scary to contemplate.  */
        struct drm_client *client = data;
        struct drm_file *pt;
        int idx;
@@ -216,8 +215,13 @@
        list_for_each_entry(pt, &dev->filelist, lhead) {
                if (i++ >= idx) {
                        client->auth = pt->authenticated;
+#ifdef __NetBSD__              /* XXX Too scary to contemplate.  */
+                       client->pid = -1;
+                       client->uid = -1;
+#else
                        client->pid = pid_vnr(pt->pid);
                        client->uid = from_kuid_munged(current_user_ns(), pt->uid);
+#endif
                        client->magic = pt->magic;
                        client->iocs = pt->ioctl_count;
                        mutex_unlock(&dev->struct_mutex);
@@ -226,7 +230,6 @@
                }
        }
        mutex_unlock(&dev->struct_mutex);
-#endif
 
        return -EINVAL;
 }



Home | Main Index | Thread Index | Old Index