From nobody@FreeBSD.org  Tue Aug 28 09:09:33 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E27A3106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Aug 2012 09:09:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id B55F58FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Aug 2012 09:09:33 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q7S99Xxq053990
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 28 Aug 2012 09:09:33 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q7S99XDB053989;
	Tue, 28 Aug 2012 09:09:33 GMT
	(envelope-from nobody)
Message-Id: <201208280909.q7S99XDB053989@red.freebsd.org>
Date: Tue, 28 Aug 2012 09:09:33 GMT
From: Damien Fleuriot <dam@my.gd>
To: freebsd-gnats-submit@FreeBSD.org
Subject: NTPd -v flag double parsing
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         171136
>Category:       bin
>Synopsis:       NTPd -v flag double parsing
>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 Aug 28 09:10:02 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Damien Fleuriot
>Release:        8.3-STABLE
>Organization:
hi-media
>Environment:
FreeBSD 8.3-STABLE #2: Wed Aug 22 10:41:47 CEST 2012 amd64
>Description:
# ntpd -v
ntpd: option `var' requires an argument
ntpd - NTP daemon program - Ver. 4.2.4p5
USAGE:  ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]...
  Flg Arg Option-Name    Description
   -4 no  ipv4           Force IPv4 DNS name resolution
   -6 no  ipv6           Force IPv6 DNS name resolution
   -a no  authreq        Require crypto authentication
   -A no  authnoreq      Do not require crypto authentication
   -b no  bcastsync      Allow us to sync to broadcast servers
   -c Str configfile     configuration file name
   -f Str driftfile      frequency drift file name
   -g no  panicgate      Allow the first adjustment to be Big
   -i Str jaildir        Jail directory
   -I Str interface      Listen on interface
   -k Str keyfile        path to symmetric keys
   -l Str logfile        path to the log file
   -L no  novirtualips   Do not listen to virtual IPs
   -n no  nofork         Do not fork
   -N no  nice           Run at high priority
   -p Str pidfile        path to the PID file
   -P Num priority       Process priority
   -q no  quit           Set the time and quit
   -r Str propagationdelay Broadcast/propagation delay
   -U Num updateinterval interval in seconds between scans for new or dropped interfaces
   -s Str statsdir       Statistics file location
   -t Str trustedkey     Trusted key number
   -u Str user           Run as userid (or userid:groupid)
   -v Str var            make ARG an ntp variable (RW)
   -V Str dvar           make ARG an ntp variable (RW|DEF)
   -x no  slew           Slew up to 600 seconds
   -v opt version        Output version information and exit
   -? no  help           Display usage information and exit
   -! no  more-help      Extended usage information passed thru pager



Notice how "-v" is reported twice, like so:
   -v Str var            make ARG an ntp variable (RW)
   -v opt version        Output version information and exit



Also notice how ntpd seems to interpret the flag twice :
# ntpd -v
ntpd: option `var' requires an argument
ntpd - NTP daemon program - Ver. 4.2.4p5

The problem doesn't arrive with ntpd --version

>How-To-Repeat:
"ntpd -v"

>Fix:
Remove the "show version" use of -v and stick with --version


>Release-Note:
>Audit-Trail:
>Unformatted:
