httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r1595034 - /httpd/httpd/trunk/support/ctlogconfig
Date Thu, 15 May 2014 20:19:11 GMT
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)



Mime
View raw message