function _with_encrypted_input_from(redir_kind, name, forms, env, d, hdlrs, st, errp, old_redir_kind, old_name, old_secret, rv) {
old_redir_kind = _INPUT_REDIR_KIND
old_name = _INPUT_NAME
old_secret = _INPUT_SECRET
if(_TYPE[redir_kind] == "s") {
if(_TYPE[name] == "s") {
if(_STRING[redir_kind] == "<") {
_INPUT_REDIR_KIND = "|"
_INPUT_REDIR_NAME = DECRYPT_COMMAND " < " _STRING[name]
} else if(_STRING[redir_kind] == "|") {
_INPUT_REDIR_KIND = "|"
_INPUT_REDIR_NAME = _STRING[name] " | " DECRYPT_COMMAND
} else {
logg_err("_with_encrypted_input_from", "unknown redir kind " _STRING[redir_kind] " - use \"<\" or \"|\"", d)
return _nil()
}
# we have lied about what is being opened; we must keep
# track of our lie in order to close the right thing.
_CLOSE_INSTEAD[name] = _INPUT_REDIR_NAME
_INPUT_SECRET = 1
rv = _evprog(forms, env, env, d, hdlrs, st, errp)
_INPUT_REDIR_KIND = old_redir_kind
_INPUT_REDIR_NAME = old_name
_INPUT_SECRET = old_secret
return rv
} else {
logg_err("_with_encrypted_input_from", "file or command should be a string", d)
return _nil()
}
} else {
logg_err("_with_encrypted_input_from", "redir kind should be a string: \"<\" or \"|\"", d)
return _nil()
}
}