<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>
Eric S. Raymond pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/2598c8a886feaf40c2a07cc4f77d7968ee31ea14">2598c8a8</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-31T07:03:11Z</i>
</div>
<pre class='commit-message'>Replay - split config file name computation from parsing...

...so that logging can get done in the right order.</pre>
</li>
</ul>
<h4>3 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
include/ntpd.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_config.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
ntpd/ntp_intercept.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/2598c8a886feaf40c2a07cc4f77d7968ee31ea14#diff-0'>
<strong>
include/ntpd.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/ntpd.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/ntpd.h
</span><span style="color: #aaaaaa">@@ -58,6 +58,7 @@ extern      char    *keysdir;       /* crypto keys and leaptable directory */
</span> extern    char *  saveconfigdir;  /* ntpq saveconfig output directory */
 
 extern const char      *getconfig      (const char *);
<span style="color: #000000;background-color: #ddffdd">+extern  void    readconfig(const char *);
</span> extern    void    ctl_clr_stats   (void);
 extern bool    ctlclrtrap      (sockaddr_u *, struct interface *, int);
 extern u_short ctlpeerstatus   (struct peer *);
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/2598c8a886feaf40c2a07cc4f77d7968ee31ea14#diff-1'>
<strong>
ntpd/ntp_config.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_config.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_config.c
</span><span style="color: #aaaaaa">@@ -4402,12 +4402,11 @@ config_remotely(
</span> 
 
 /*
<span style="color: #000000;background-color: #ffdddd">- * getconfig() - process startup configuration file e.g /etc/ntp.conf
</span><span style="color: #000000;background-color: #ddffdd">+ * getconfig() - return name of configuration file e.g /etc/ntp.conf
</span>  */
 const char *
 getconfig(const char *explicit_config)
 {
<span style="color: #000000;background-color: #ffdddd">-        char    line[256];
</span>   const char *config_file;
 
 #ifndef SYS_WINNT
<span style="color: #aaaaaa">@@ -4442,6 +4441,20 @@ getconfig(const char *explicit_config)
</span>       config_file = explicit_config;
        }
 
<span style="color: #000000;background-color: #ddffdd">+#ifdef SYS_WINNT
+       if (access(config_file, R_OK) != 0)
+           config_file = alt_config_file;
+#endif /* SYS_WINNT */
+
+       return config_file;
+}
+
+/*
+ * readconfig() - process startup configuration file
+ */
+void readconfig(const char *config_file)
+{
+       char    line[256];
</span>   /*
         * install a non default variable with this daemon version
         */
<span style="color: #aaaaaa">@@ -4468,22 +4481,7 @@ getconfig(const char *explicit_config)
</span>           if (!saveconfigquit && intercept_get_mode() != replay)
                        io_open_sockets();
 
<span style="color: #000000;background-color: #ffdddd">-                return NULL;
-#else
-               /* Under WinNT try alternate_config_file name, first NTP.CONF, then NTP.INI */
-
-               if (!lex_init_stack(alt_config_file, "r"))  {
-                       /*
-                        * Broadcast clients can sometimes run without
-                        * a configuration file.
-                        */
-                       msyslog(LOG_INFO, "getconfig: Couldn't open <%s>: %m", alt_config_file);
-                       if (!saveconfigquit && intercept_get_mode() != replay)
-                               io_open_sockets();
-
-                       return NULL;
-               }
-               cfgt.source.value.s = estrdup(alt_config_file);
</span><span style="color: #000000;background-color: #ddffdd">+           return;
</span> #endif    /* SYS_WINNT */
        } else
                cfgt.source.value.s = estrdup(config_file);
<span style="color: #aaaaaa">@@ -4510,8 +4508,6 @@ getconfig(const char *explicit_config)
</span>   if (config_netinfo)
                free_netinfo_config(config_netinfo);
 #endif /* HAVE_NETINFO_NI_H */
<span style="color: #000000;background-color: #ffdddd">-
-       return config_file;
</span> }
 
 
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/2598c8a886feaf40c2a07cc4f77d7968ee31ea14#diff-2'>
<strong>
ntpd/ntp_intercept.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_intercept.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_intercept.c
</span><span style="color: #aaaaaa">@@ -110,7 +110,6 @@ static intercept_mode mode = none;
</span> 
 static char linebuf[256];
 static int lineno;
<span style="color: #000000;background-color: #ffdddd">-static double saved_drift;
</span> 
 intercept_mode intercept_get_mode(void)
 {
<span style="color: #aaaaaa">@@ -312,7 +311,7 @@ void intercept_getconfig(const char *configfile)
</span>   get_operation("startconfig");
        snprintf(tempfile, sizeof(tempfile), ".fake_ntp_config_%d", getpid());
        file_replay(configfile, "endconfig", tempfile);
<span style="color: #000000;background-color: #ffdddd">-        getconfig(tempfile);
</span><span style="color: #000000;background-color: #ddffdd">+   readconfig(getconfig(tempfile));
</span>   unlink(tempfile);
     } else {
        /* this can be null if the default config doesn't exist */
<span style="color: #aaaaaa">@@ -321,13 +320,7 @@ void intercept_getconfig(const char *configfile)
</span>   if (configfile != NULL && mode == capture)
            pump(configfile, "startconfig\n", "endconfig\n", stdout);
 
<span style="color: #000000;background-color: #ffdddd">-        /*
-        * Has to be done here because intercept_drift_read() is called from
-        * inside the config parser - otherwise, things get emitted in the
-        * wrong order.
-        */
-       if (mode == capture)
-           printf("drift-read %.3f\n", saved_drift);
</span><span style="color: #000000;background-color: #ddffdd">+   readconfig(configfile);
</span>     }
 }
 
<span style="color: #aaaaaa">@@ -432,8 +425,9 @@ bool intercept_drift_read(const char *drift_file, double *drift)
</span>   }
        fclose(fp);
 
<span style="color: #000000;background-color: #ffdddd">-        /* capture write has to be done in the config intercwept */
-       saved_drift = *drift;
</span><span style="color: #000000;background-color: #ddffdd">+   if (mode == capture)
+           printf("drift-read %.3f\n", *drift);
+
</span>     }
 
     return true;
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/2598c8a886feaf40c2a07cc4f77d7968ee31ea14">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/2598c8a886feaf40c2a07cc4f77d7968ee31ea14"}}</script>
</p>
</div>
</body>
</html>