You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2018/07/31 20:25:25 UTC

[trafficserver] 01/03: Fixes ticket loading from filesystems without a mtime

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 8.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7506f5bec60fa163ef149b259a7a612b68ca0d3f
Author: Randall Meyer <ra...@yahoo.com>
AuthorDate: Fri Jul 27 14:47:39 2018 -0700

    Fixes ticket loading from filesystems without a mtime
    
    (cherry picked from commit bd7741f8465045eece77664242ca5e88d0709bd8)
---
 iocore/net/SSLConfig.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index c034cbc..106044e 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -552,6 +552,7 @@ SSLTicketParams::LoadTicket()
   SSLConfig::scoped_config params;
   time_t last_load_time    = 0;
   bool no_default_keyblock = true;
+
   SSLTicketKeyConfig::scoped_config ticket_params;
   if (ticket_params) {
     last_load_time      = ticket_params->load_time;
@@ -563,8 +564,9 @@ SSLTicketParams::LoadTicket()
     ats_scoped_str ticket_key_path(Layout::relative_to(params->serverCertPathOnly, ticket_key_filename));
     // See if the file changed since we last loaded
     struct stat sdata;
-    if (stat(ticket_key_filename, &sdata) >= 0) {
-      if (sdata.st_mtime <= last_load_time) {
+    if (last_load_time && (stat(ticket_key_filename, &sdata) >= 0)) {
+      if (sdata.st_mtime && sdata.st_mtime <= last_load_time) {
+        Debug("ssl", "ticket key %s has not changed", ticket_key_filename);
         // No updates since last load
         return false;
       }
@@ -585,7 +587,6 @@ SSLTicketParams::LoadTicket()
 
   Debug("ssl", "ticket key reloaded from %s", ticket_key_filename);
   return true;
-
 #endif
 }