Subject: bin/15800: /etc/rc.d/ntpdate does not honor $flags from environment
To: None <gnats-bugs@gnats.netbsd.org>
From: None <richards@CS.Princeton.EDU>
List: netbsd-bugs
Date: 03/03/2002 23:57:16
>Number: 15800
>Category: bin
>Synopsis: /etc/rc.d/ntpdate does not honor $flags from environment
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 03 20:58:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Chris Richards
>Release: NetBSD 1.5.3_ALPHA
>Organization:
>Environment:
System: NetBSD zembla.Princeton.EDU 1.5.3_ALPHA NetBSD 1.5.3_ALPHA (ZEMBLA) #11: Sat Mar 2 23:34:00 EST 2002 richards@zembla.Princeton.EDU:/usr/home/richards/kern i386
Architecture: i386
Machine: i386
>Description:
/etc/rc.d/ntpdate, because it specifies $ntpdate_flags explicitly
in its custom start_cmd, does not honor $flags from the environment
the way rc.subr suggests it should.
>How-To-Repeat:
Run "flags='-B' /etc/rc.d/ntpdate start" and notice that ntpdate
stepped, not slewed, the clock.
>Fix:
The fix is easy but ugly. Would that /bin/sh had lexical scoping.
--- /usr/src/etc/rc.d/ntpdate Sun Oct 1 21:09:51 2000
+++ /etc/rc.d/ntpdate Sun Mar 3 23:38:15 2002
@@ -23,7 +23,7 @@
fi
if [ -n "$ntpdate_hosts" ]; then
echo "Setting date via ntp."
- ntpdate $ntpdate_flags $ntpdate_hosts
+ ntpdate $_flags $ntpdate_hosts
fi
}
>Release-Note:
>Audit-Trail:
>Unformatted: