diff options
author | Jeff Trawick <trawick@apache.org> | 2014-05-15 22:19:10 +0200 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2014-05-15 22:19:10 +0200 |
commit | 56da5cba0adb272b74de745de6e9bf85ae39e1ad (patch) | |
tree | 3d9fd62ae62d2b23d542969bd33483f6ed493dc6 /support/ctlogconfig | |
parent | mod_cache: follow up to r1594643. (diff) | |
download | apache2-56da5cba0adb272b74de745de6e9bf85ae39e1ad.tar.xz apache2-56da5cba0adb272b74de745de6e9bf85ae39e1ad.zip |
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
Diffstat (limited to 'support/ctlogconfig')
-rwxr-xr-x | support/ctlogconfig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/support/ctlogconfig b/support/ctlogconfig index 4ebef5cb07..a3ac6ff585 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) |