<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>
Hal Murray 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/3730f21ee8796a64ab166862ef83776941780b7e">3730f21e</a></strong>
<div>
<span>by Hal Murray</span>
<i>at 2015-12-22T01:48:22Z</i>
</div>
<pre class='commit-message'>Add logging to authreadkeys, handy for debugging</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/9fac4ea48fdbcacb2d6ce53f0491446d2414af55">9fac4ea4</a></strong>
<div>
<span>by Hal Murray</span>
<i>at 2015-12-22T01:49:14Z</i>
</div>
<pre class='commit-message'>Switch to log file (from ntp.conf) earlier

So some error messages are easier to find.</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
libntp/authreadkeys.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_config.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/036c281ac07d8f137112ad740f96a21f635831d1...9fac4ea48fdbcacb2d6ce53f0491446d2414af55#diff-0'>
<strong>
libntp/authreadkeys.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/libntp/authreadkeys.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/libntp/authreadkeys.c
</span><span style="color: #aaaaaa">@@ -79,6 +79,7 @@ authreadkeys(
</span>   uint8_t keystr[32];             /* Bug 2537 */
        size_t  len;
        size_t  j;
<span style="color: #000000;background-color: #ddffdd">+        int     keys = 0;
</span> 
        /*
         * Open file.  Complain and return if it can't be opened.
<span style="color: #aaaaaa">@@ -90,6 +91,7 @@ authreadkeys(
</span>           return false;
        }
        INIT_SSL();
<span style="color: #000000;background-color: #ddffdd">+msyslog(LOG_ERR, "authreadkeys: reading %s", file);
</span> 
        /*
         * Remove all existing keys
<span style="color: #aaaaaa">@@ -177,6 +179,7 @@ authreadkeys(
</span>           len = strlen(token);
                if (len <= 20) {     /* Bug 2537 */
                        MD5auth_setkey(keyno, keytype, (uint8_t *)token, len);
<span style="color: #000000;background-color: #ddffdd">+                        keys++;
</span>           } else {
                        char    hex[] = "0123456789abcdef";
                        uint8_t temp;
<span style="color: #aaaaaa">@@ -200,8 +203,10 @@ authreadkeys(
</span>                           continue;
                        }
                        MD5auth_setkey(keyno, keytype, keystr, jlim / 2);
<span style="color: #000000;background-color: #ddffdd">+                        keys++;
</span>           }
        }
        fclose(fp);
<span style="color: #000000;background-color: #ddffdd">+msyslog(LOG_ERR, "authreadkeys: added %d keys", keys);
</span>   return true;
 }
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/036c281ac07d8f137112ad740f96a21f635831d1...9fac4ea48fdbcacb2d6ce53f0491446d2414af55#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">@@ -276,6 +276,7 @@ static void config_rlimit(config_tree *);
</span> static void config_system_opts(config_tree *);
 static void config_tinker(config_tree *);
 static void config_tos(config_tree *);
<span style="color: #000000;background-color: #ddffdd">+static void config_logfile(config_tree *);
</span> static void config_vars(config_tree *);
 
 #ifdef SIM
<span style="color: #aaaaaa">@@ -3422,6 +3423,33 @@ free_config_fudge(
</span> #endif    /* FREE_CFG_T */
 
 
<span style="color: #000000;background-color: #ddffdd">+/* Clone of config_vars that only does log file. */
+static void
+config_logfile(
+       config_tree *ptree
+       )
+{
+       attr_val *curr_var;
+
+       curr_var = HEAD_PFIFO(ptree->vars);
+       for (; curr_var != NULL; curr_var = curr_var->link) {
+               /* Determine which variable to set and set it */
+               switch (curr_var->attr) {
+
+               case T_Logfile:
+                       if (-1 == change_logfile(curr_var->value.s, true))
+                               msyslog(LOG_ERR,
+                                       "Cannot open logfile %s: %m",
+                                       curr_var->value.s);
+                       break;
+
+               default:
+                       break;
+               }
+       }
+}
+
+
</span> static void
 config_vars(
        config_tree *ptree
<span style="color: #aaaaaa">@@ -3481,10 +3509,7 @@ config_vars(
</span>                   break;
 
                case T_Logfile:
<span style="color: #000000;background-color: #ffdddd">-                        if (-1 == change_logfile(curr_var->value.s, true))
-                               msyslog(LOG_ERR,
-                                       "Cannot open logfile %s: %m",
-                                       curr_var->value.s);
</span><span style="color: #000000;background-color: #ddffdd">+                   /* processed in config_logfile */
</span>                   break;
 
                case T_Saveconfigdir:
<span style="color: #aaaaaa">@@ -4262,6 +4287,11 @@ config_ntpd(
</span>   bool input_from_files
        )
 {
<span style="color: #000000;background-color: #ddffdd">+
+/* Do this early so most errors go to new log file */
+/* Command line arg is earlier. */
+       config_logfile(ptree);
+
</span>   config_nic_rules(ptree, input_from_files);
        config_monitor(ptree);
        config_auth(ptree);
</code></pre>

<br>
</li>

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

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/036c281ac07d8f137112ad740f96a21f635831d1...9fac4ea48fdbcacb2d6ce53f0491446d2414af55">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.

</p>
</div>
</body>
</html>