Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/rpc.yppasswdd The "-m" option makes onyl sense with...



details:   https://anonhg.NetBSD.org/src/rev/7adb56b33057
branches:  trunk
changeset: 500238:7adb56b33057
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Dec 08 21:51:21 2000 +0000

description:
The "-m" option makes onyl sense with at least one argument. So enforce
that and update the documentation accordingly.

diffstat:

 usr.sbin/rpc.yppasswdd/rpc.yppasswdd.8 |  6 +++---
 usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c |  9 +++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r 2ec7679e6e3e -r 7adb56b33057 usr.sbin/rpc.yppasswdd/rpc.yppasswdd.8
--- a/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.8    Fri Dec 08 21:51:02 2000 +0000
+++ b/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.8    Fri Dec 08 21:51:21 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: rpc.yppasswdd.8,v 1.8 2000/07/05 15:45:32 msaitoh Exp $
+.\"    $NetBSD: rpc.yppasswdd.8,v 1.9 2000/12/08 21:51:21 tron Exp $
 .\"
 .\" Copyright (c) 1994 Mats O Jansson <moj%stacken.kth.se@localhost>
 .\" All rights reserved.
@@ -40,7 +40,7 @@
 .Op Fl noshell
 .Op Fl nogecos
 .Op Fl nopw
-.Op Fl m Ar arg1 arg2 ... 
+.Op Fl m Ar arg1 Op Ar arg2 ... 
 .Sh DESCRIPTION
 .Nm
 must be running on the
@@ -56,7 +56,7 @@
 Don't allow changes of the gecos field in the passwd file.
 .It Fl nopw
 Don't allow changes of the password in the passwd file.
-.It Fl m Ar arg1 arg2 ...
+.It Fl m Ar arg1 Op Ar arg2 ...
 Additional arguments to pass to 
 .Ar make 
 in
diff -r 2ec7679e6e3e -r 7adb56b33057 usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c
--- a/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c    Fri Dec 08 21:51:02 2000 +0000
+++ b/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.c    Fri Dec 08 21:51:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpc.yppasswdd.c,v 1.6 2000/12/08 21:24:16 tron Exp $   */
+/*     $NetBSD: rpc.yppasswdd.c,v 1.7 2000/12/08 21:51:21 tron Exp $   */
 
 /*
  * Copyright (c) 1994 Mats O Jansson <moj%stacken.kth.se@localhost>
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: rpc.yppasswdd.c,v 1.6 2000/12/08 21:24:16 tron Exp $");
+__RCSID("$NetBSD: rpc.yppasswdd.c,v 1.7 2000/12/08 21:51:21 tron Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -85,7 +85,8 @@
                        int len;
 
                        len = strlen(make_arg);
-                       i++;
+                       if (++i == argc)
+                               usage();
                        for (; i < argc; i++) {
                                int arglen;
 
@@ -168,6 +169,6 @@
 {
 
        fprintf(stderr, "usage: %s [-noshell] [-nogecos] [-nopw] "
-           "[-m arg1 arg2 ...]\n", __progname);
+           "[-m arg1 [arg2 ...]]\n", __progname);
        exit(EXIT_FAILURE);
 }



Home | Main Index | Thread Index | Old Index