[Nagiosplug-devel] spopenenv (Was: no subject)
Andreas Ericsson
ae at op5.se
Thu Oct 13 04:17:29 CEST 2005
Ton Voon wrote:
>
> On 12 Oct 2005, at 18:59, John P. Rouillard wrote:
>
>>
>> Hello all:
>>
>> I have been trying to use check_by_ssh with an ssh-agent to allow
>> encrypted keys to be kept on the system.
>>
>> While using spopen in the plugin is a great idea, it breaks using the
>> ssh-agent to manage keys since the required environment variable:
>> SSH_AUTH_SOCK isn't present in the child environment.
>>
>> I had patched this once (at another job, code unavailable) by
>> duplicating spopen to spopenenv and adding a second argument that was
>> a list of the environment strings (retrieved with getenv) that should
>> be added to the child environment.
>>
>> So does adding support to check_by_ssh to use an ssh-agent sound
>> reasonable?
>
>
> I think this sounds like a good idea.
>
> Is it possible to have the 2nd argument to spopen be the optional array
> of variables? That way we're not trying to maintain a spopen and an
> spopenenv.
>
FILE *spopenenv(const char *cmd, char **envp);
#define spopen(cmd) spopenenv(cmd, NULL)
No hassle while staying backwards-compatible.
--
Andreas Ericsson andreas.ericsson at op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
More information about the Devel
mailing list