Module Name:    src
Committed By:   riastradh
Date:           Wed Jan 15 13:52:20 UTC 2014

Modified Files:
        src/sys/external/bsd/drm2/dist/drm [riastradh-drm2]: drm_ioctl.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1.2.3 -r1.1.1.1.2.4 \
    src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.1.1.1.2.3 src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.1.1.1.2.4
--- src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c:1.1.1.1.2.3	Wed Jul 24 02:26:23 2013
+++ src/sys/external/bsd/drm2/dist/drm/drm_ioctl.c	Wed Jan 15 13:52:20 2014
@@ -203,7 +203,6 @@ int drm_getmap(struct drm_device *dev, v
 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 @@ int drm_getclient(struct drm_device *dev
 	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 @@ int drm_getclient(struct drm_device *dev
 		}
 	}
 	mutex_unlock(&dev->struct_mutex);
-#endif
 
 	return -EINVAL;
 }

Reply via email to