[Nagiosplug-devel] setting LC=ALL in spopen.c

Karl DeBisschop karl at debisschop.net
Thu Jul 31 20:00:03 CEST 2003


The role of spopen() has been to provide a central piece of code for
exec of system utilities like 'ps'.  In the interest of security, it is
fairly restrictive - it excludes shell expansions and strips the
environment down to nothing.

In marking up the plugins for translation, I noticed that where we use
spopen and scan through resulting output for variuos strings, I think we
could get flummoxed if the system default LOCALE is not english. My
proposed solutio is to change:

 	char *environ[] = { NULL };


to:

	char *environ[] = { "LC_ALL=C", char*(0) };

I have two questions:

1) Is this really a problem we need to worry about, or does the current
NULL environment override any language defaults on the machine.

2) If it is a problem, do people feel that the above is an appropriate
way to handle it?

--
Karl





More information about the Devel mailing list