You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2014/05/15 22:19:11 UTC

svn commit: r1595034 - /httpd/httpd/trunk/support/ctlogconfig

Author: trawick
Date: Thu May 15 20:19:10 2014
New Revision: 1595034

URL: http://svn.apache.org/r1595034
Log:
Ensure that min/max valid timestamps (milliseconds since the epoch)
make sense:  no negative numbers, and require an input of "-" instead
of "0" to indicate that the timestamp isn't being provided.

Modified:
    httpd/httpd/trunk/support/ctlogconfig

Modified: httpd/httpd/trunk/support/ctlogconfig
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ctlogconfig?rev=1595034&r1=1595033&r2=1595034&view=diff
==============================================================================
--- httpd/httpd/trunk/support/ctlogconfig (original)
+++ httpd/httpd/trunk/support/ctlogconfig Thu May 15 20:19:10 2014
@@ -88,12 +88,19 @@ def time_arg(args):
     t = args.pop(0)
     if t == '-':
         return None
+    bad_val = False
+    val = None
     try:
-        return int(t)
+        val = int(t)
     except ValueError:
+        bad_val = True
+
+    if bad_val or val < 1:
         print >> sys.stderr, 'The timestamp "%s" is invalid' % t
         sys.exit(1)
 
+    return val
+
 
 def configure_public_key(cur, args):
     record_id = record_id_arg(cur, args, False)