* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: job.c,v 1.68 2007-04-14 16:59:56 thib Exp $ */
+ /* $Id: job.c,v 1.69 2007-04-14 17:45:35 thib Exp $ */
#include "fcron.h"
char env_logname[PATH_LEN];
char env_home[PATH_LEN];
char env_shell[PATH_LEN];
+char env_tz[PATH_LEN];
#endif
#ifdef WITH_SELINUX
setenv("USER", pas->pw_name, 1);
setenv("LOGNAME", pas->pw_name, 1);
setenv("HOME", pas->pw_dir, 1);
+ if (cl->cl_tz != NULL)
+ setenv("TZ", cl->cl_tz, 1);
/* To ensure compatibility with Vixie cron, we don't use the shell defined
* in /etc/passwd by default, but the default value from fcron.conf instead: */
if ( *shell == '\0' )
env_home[sizeof(env_home)-1]='\0';
putenv( env_home );
+ if (cl->cl_tz != NULL) {
+ strcpy(env_tz, "TZ=");
+ strncat(env_tz, pas->pw_dir, sizeof(env_tz)-3-1);
+ env_tz[sizeof(env_tz)-1]='\0';
+ putenv( env_tz );
+ }
+
strcpy(env_shell, "SHELL=");
/* To ensure compatibility with Vixie cron, we don't use the shell defined
* in /etc/passwd by default, but the default value from fcron.conf instead: */