]> granicus.if.org Git - apache/commitdiff
Ensure that min/max valid timestamps (milliseconds since the epoch)
authorJeff Trawick <trawick@apache.org>
Thu, 15 May 2014 20:19:10 +0000 (20:19 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 15 May 2014 20:19:10 +0000 (20:19 +0000)
make sense:  no negative numbers, and require an input of "-" instead
of "0" to indicate that the timestamp isn't being provided.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1595034 13f79535-47bb-0310-9956-ffa450edef68

support/ctlogconfig

index 4ebef5cb0772f680bfe221e69c787b57f83c80be..a3ac6ff5855d7e311080f5b1b8c9df4ecfc365cb 100755 (executable)
@@ -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)