From: Jeff Trawick Date: Thu, 15 May 2014 20:19:10 +0000 (+0000) Subject: Ensure that min/max valid timestamps (milliseconds since the epoch) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e08b91c17241b1c43f12684dd730fbc42f6a6388;p=thirdparty%2Fapache%2Fhttpd.git 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1595034 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/ctlogconfig b/support/ctlogconfig index 4ebef5cb077..a3ac6ff5855 100755 --- a/support/ctlogconfig +++ b/support/ctlogconfig @@ -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)