From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 28 11:20:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97DBC132 for ; Tue, 28 Jan 2014 11:20:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 735A911F2 for ; Tue, 28 Jan 2014 11:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s0SBK0sR068183 for ; Tue, 28 Jan 2014 11:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id s0SBK0xQ068182; Tue, 28 Jan 2014 11:20:00 GMT (envelope-from gnats) Resent-Date: Tue, 28 Jan 2014 11:20:00 GMT Resent-Message-Id: <201401281120.s0SBK0xQ068182@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Fernando Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8C18FE9 for ; Tue, 28 Jan 2014 11:15:41 +0000 (UTC) Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4F8411B7 for ; Tue, 28 Jan 2014 11:15:41 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s0SBFfUM096896 for ; Tue, 28 Jan 2014 11:15:41 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s0SBFfFp096892; Tue, 28 Jan 2014 11:15:41 GMT (envelope-from nobody) Message-Id: <201401281115.s0SBFfFp096892@oldred.freebsd.org> Date: Tue, 28 Jan 2014 11:15:41 GMT From: Fernando To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/186187: [linprocfs] [patch] emulate /proc/sys/kernel/random/uuid X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 11:20:00 -0000 >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 #include #include +#include #include #include #include @@ -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: