>Number:         186187
>Category:       kern
>Synopsis:       [linprocfs] [patch] emulate /proc/sys/kernel/random/uuid
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 28 11:20:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Fernando
>Release:        9.1-RELEASE
>Organization:
>Environment:
>Description:
This patch implements /proc/sys/kernel/random/uuid for the linuxulator.

This is related to kern/183615 but the original submitter of the PR doesn't 
seem to be interested...
>How-To-Repeat:
Try to open that file under compat linux
>Fix:
Apply the attached patch.

Patch attached with submission follows:

--- compat/linprocfs/linprocfs.c.orig   2013-11-06 18:59:41.000000000 +0100
+++ compat/linprocfs/linprocfs.c        2013-11-06 23:56:22.000000000 +0100
@@ -72,6 +72,7 @@
 #include <sys/time.h>
 #include <sys/tty.h>
 #include <sys/user.h>
+#include <sys/uuid.h>
 #include <sys/vmmeter.h>
 #include <sys/vnode.h>
 #include <sys/bus.h>
@@ -1347,6 +1348,23 @@
        return (0);
 }
 
+
+/*
+ * Filler function for proc/sys/kernel/random/uuid
+ */
+static int
+linprocfs_douuid(PFS_FILL_ARGS)
+{
+       struct uuid uuid;
+
+       kern_uuidgen(&uuid, 1);
+
+       sbuf_printf_uuid(sb, &uuid);
+       sbuf_printf(sb, "\n");
+
+       return(0);
+}
+
 /*
  * Constructor
  */
@@ -1445,6 +1463,8 @@
            NULL, NULL, NULL, PFS_RD);
        pfs_create_file(dir, "sem", &linprocfs_dosem,
            NULL, NULL, NULL, PFS_RD);
+       pfs_create_file(dir, "random", &linprocfs_douuid,
+           NULL, NULL, NULL, PFS_RD);
 
        return (0);
 }


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to