git: ea70ab2387e5 - main - Use the actual credentials to create the /dev/nmdm* devices.

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 4 13:19:41 UTC 2021


The branch main has been updated by phk:

URL: https://cgit.FreeBSD.org/src/commit/?id=ea70ab2387e5749450ddeb150d40074bc940c695

commit ea70ab2387e5749450ddeb150d40074bc940c695
Author:     Poul-Henning Kamp <phk at FreeBSD.org>
AuthorDate: 2021-01-04 13:18:47 +0000
Commit:     Poul-Henning Kamp <phk at FreeBSD.org>
CommitDate: 2021-01-04 13:18:47 +0000

    Use the actual credentials to create the /dev/nmdm* devices.
    
    This lets plain users create nmdm pairs, which is useful amongst
    other things for running retro-computing emulators etc.
---
 sys/dev/nmdm/nmdm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index 19402f8c946b..61de05d4a41f 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -195,7 +195,7 @@ nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen,
 	tp = ns->ns_part1.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part1,
 	    &ns->ns_mtx);
 	*end = 'A';
-	error = tty_makedevf(tp, NULL, endc == 'A' ? TTYMK_CLONING : 0,
+	error = tty_makedevf(tp, cred, endc == 'A' ? TTYMK_CLONING : 0,
 	    "%s", name);
 	if (error) {
 		*end = endc;
@@ -207,7 +207,7 @@ nmdm_clone(void *arg, struct ucred *cred, char *name, int nameen,
 	tp = ns->ns_part2.np_tty = tty_alloc_mutex(&nmdm_class, &ns->ns_part2,
 	    &ns->ns_mtx);
 	*end = 'B';
-	error = tty_makedevf(tp, NULL, endc == 'B' ? TTYMK_CLONING : 0,
+	error = tty_makedevf(tp, cred, endc == 'B' ? TTYMK_CLONING : 0,
 	    "%s", name);
 	if (error) {
 		*end = endc;


More information about the dev-commits-src-all mailing list