Add checks for keyserver and recv-keys options to _parsers module.

testing/mmn/mktime_takes_localtime_not_gmtime
Isis Lovecruft 2013-06-03 11:15:42 +00:00
parent a03d666d0a
commit 2c95074006
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 15 additions and 4 deletions

View File

@ -389,6 +389,9 @@ def _is_allowed(input):
'--no-default-keyring',
'--default-key',
'--no-options',
'--keyserver',
'--recv-keys',
'--send-keys',
## preferences
'--digest-algo',
'--cipher-algo',
@ -530,11 +533,19 @@ def _sanitise(*args):
## because they are only allowed if the pass the regex
if flag in ['--default-key', '--recipient', '--export',
'--export-secret-keys', '--delete-keys',
'--list-sigs', '--export-secret-subkeys',]:
if _is_hex(v):
safe_option += (v + " ")
continue
'--list-sigs', '--export-secret-subkeys',
'--recv-keys']:
if _is_hex(v): safe_option += (v + " ")
else: log.debug("'%s %s' not hex." % (flag, v))
continue
elif flag in ['--keyserver']:
host = _check_keyserver(v)
if host:
log.debug("Setting keyserver: %s" % host)
safe_option += (v + " ")
else: log.debug("Dropping keyserver: %s" % v)
continue
val = _fix_unsafe(v)