[Nagiosplug-devel] spopenenv (Was: no subject)

John P. Rouillard rouilj at cs.umb.edu
Thu Oct 13 05:41:37 UTC 2005


In message <02F3F455-47E6-453A-A6F3-B9DABFE654B2 at mac.com>,
Ton Voon writes:
>On 12 Oct 2005, at 18:59, John P. Rouillard wrote:
>> 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.

You could use a varargs list I suppose. Another way to do it might be
with a macro that maps:

   spopen(a) -> spopenenv (a, NULL)

and then you just have spopenenv. But it's been a long time since I have
done C programming (almost 20 years sigh).

BTW, Thanks for adding the subject. Mistakenly sent it without one.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.




More information about the Nagiosplugin-devel mailing list