[ntpsec commit] Forward-port [Bug 2902] configuration directives "pidfile" and "driftfile"...
Eric S. Raymond
esr at ntpsec.org
Fri Oct 23 04:26:06 UTC 2015
Module: ntpsec
Branch: master
Commit: b0c80150d1f4a25b8da3d72f6cc67ea6cf9b80dd
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=b0c80150d1f4a25b8da3d72f6cc67ea6cf9b80dd
Author: Miroslav Lichvar <mlichvar at redhat.com>
Date: Fri Oct 23 00:07:44 2015 -0400
Forward-port [Bug 2902] configuration directives "pidfile" and "driftfile"...
...should be local-only.
---
NEWS | 3 +++
ntpd/ntp_parser.y | 14 +++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/NEWS b/NEWS
index 699a3cc..f8893db 100644
--- a/NEWS
+++ b/NEWS
@@ -28,5 +28,8 @@ on user-visible changes.
* [Bug 2883] ntpd crashes on exit with empty driftfile. Miroslav Lichvar.
* [Bug 2886] Misspelling: "outlyer" should be "outlier"
* [Bug 2890] Ignore ENOBUFS on routing netlink socket. Konstantin Khlebnikov.
+* [Bug 2902] configuration directives "pidfile" and "driftfile"
+ should be local-only. (patch by Miroslav Lichvar)
+
// end
diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y
index 6c244da..d274f49 100644
--- a/ntpd/ntp_parser.y
+++ b/ntpd/ntp_parser.y
@@ -1227,21 +1227,25 @@ misc_cmd_int_keyword
misc_cmd_str_keyword
: T_Ident
| T_Leapfile
- | T_Pidfile
;
misc_cmd_str_lcl_keyword
: T_Logfile
+ | T_Pidfile
| T_Saveconfigdir
;
drift_parm
: T_String
{
- attr_val *av;
-
- av = create_attr_sval(T_Driftfile, $1);
- APPEND_G_FIFO(cfgt.vars, av);
+ if (lex_from_file()) {
+ attr_val *av;
+ av = create_attr_sval(T_Driftfile, $1);
+ APPEND_G_FIFO(cfgt.vars, av);
+ } else {
+ YYFREE($1);
+ yyerror("driftfile remote configuration ignored");
+ }
}
| T_String T_Double
{
More information about the vc
mailing list