Subject: bin/14216: ntpd(8) config file parsing error
To: SEND-PR <gnats-bugs@gnats.netbsd.org>
From: Don Yuniskis <auryn@gci-net.com>
List: netbsd-bugs
Date: 10/10/2001 14:20:42
>Number: 14216
>Category: bin
>Synopsis: ntpd(8) won't recognize keyid's > 0x9
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Oct 10 14:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Don Yuniskis
>Release: NetBSD 1.5.2
>Organization:
Don Yuniskis
>Environment:
System: NetBSD Some.machine 1.5.2 NetBSD 1.5.2 (DGY) #0: Wed Sep 26 23:29:30
MST
2001 toor@some.machine:/usr/src/sys/arch/sparc/compile/DGY sparc
Note that this also applies to i386, etc.
>Description:
keyid's encountered in an ntpd configuration file (e.g.,
/etc/ntp.conf)
having values which contain non-decimal characters (e.g., [a-fA-F])
in their hexadecimal equivalents are not recognized. Simple
screwup...
>How-To-Repeat:
specify a keyid of "10" (decimal) in a configuration file
and start ntpd(8). Error message will appear immediately
>Fix:
N.B. I have not yet built ntpd with this patch!! Instead, I
have manually patched the *binary* -- replacing the "08x"
with "12u" (suboptimal choice) -- which has been working
fine now...
Patch *should* work but we've all uttered those "famous last
words"...
*** ntp_config.c.old Sat Apr 22 08:49:32 2000
--- ntp_config.c Wed Oct 10 14:04:44 2001
***************
*** 2380,2390 ****
}
#endif
! (void)fprintf(res_fp, "%s %d %d %d %d %d %d %08x %s\n", name,
mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr);
#ifdef DEBUG
if (debug > 1)
! printf("config: %s %d %d %d %d %d %d %08x %s\n", name, mode,
version, minpoll, maxpoll, flags, ttl, keyid, keystr);
#endif
--- 2380,2390 ----
}
#endif
! (void)fprintf(res_fp, "%s %d %d %d %d %d %d %u %s\n", name,
mode, version, minpoll, maxpoll, flags, ttl, keyid, keystr);
#ifdef DEBUG
if (debug > 1)
! printf("config: %s %d %d %d %d %d %d %u %s\n", name, mode,
version, minpoll, maxpoll, flags, ttl, keyid, keystr);
#endif
>Release-Note:
>Audit-Trail:
>Unformatted:
X-send-pr-version: 3.95