Source-Changes-HG archive

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

[src/trunk]: src/sbin/mknod Accept driver names only in the two args form tog...



details:   https://anonhg.NetBSD.org/src/rev/dd0b0c94d9b0
branches:  trunk
changeset: 331751:dd0b0c94d9b0
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Fri Aug 22 22:28:50 2014 +0000

description:
Accept driver names only in the two args form together with a minor number.

That's what the documentation says and also avoids the case where the driver
name converted to a major number is interpreted as a packed dev_t number.

diffstat:

 sbin/mknod/mknod.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5c662777dc37 -r dd0b0c94d9b0 sbin/mknod/mknod.c
--- a/sbin/mknod/mknod.c        Fri Aug 22 21:28:20 2014 +0000
+++ b/sbin/mknod/mknod.c        Fri Aug 22 22:28:50 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mknod.c,v 1.41 2013/06/14 16:28:20 tsutsui Exp $       */
+/*     $NetBSD: mknod.c,v 1.42 2014/08/22 22:28:50 mlelstv Exp $       */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1998\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: mknod.c,v 1.41 2013/06/14 16:28:20 tsutsui Exp $");
+__RCSID("$NetBSD: mknod.c,v 1.42 2014/08/22 22:28:50 mlelstv Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -223,7 +223,7 @@
                if (*p == 0 && errno == 0)
                        continue;
 #ifdef KERN_DRIVERS
-               if (n == 0) {
+               if (argc == 2 && n == 0) {
                        major = major_from_name(argv[0], mode);
                        if (major != -1) {
                                numbers[0] = major;



Home | Main Index | Thread Index | Old Index