summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-09-29 21:45:57 +0000
committerdelphij <delphij@FreeBSD.org>2014-09-29 21:45:57 +0000
commitec42adf015f0a77140d132106d660d83331a8ed8 (patch)
tree47a54901d237a471c4e0805c2dad4f7a0600f881
parent4f65713d76096f88821897d915cca39a21390c94 (diff)
downloadFreeBSD-src-ec42adf015f0a77140d132106d660d83331a8ed8.zip
FreeBSD-src-ec42adf015f0a77140d132106d660d83331a8ed8.tar.gz
When setting environment variables in the atrun script, use the
"export foo=bar" form instead of "foo=bar; export foo" since the former allows the shell to catch variable names that are not valid shell identifiers. This will cause /bin/sh to exit with an error (which gets mailed to the at user) and it will not run the script. Obtained from: OpenBSD (r1.63 millert) MFC after: 3 days
-rw-r--r--usr.bin/at/at.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 5f4500b..18367dd 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -367,6 +367,7 @@ writefile(time_t runtimer, char queue)
if (export)
{
+ (void)fputs("export ", fp);
fwrite(*atenv, sizeof(char), eqp-*atenv, fp);
for(ap = eqp;*ap != '\0'; ap++)
{
@@ -389,7 +390,6 @@ writefile(time_t runtimer, char queue)
fputc(*ap, fp);
}
}
- fputs("; export ", fp);
fwrite(*atenv, sizeof(char), eqp-*atenv -1, fp);
fputc('\n', fp);
OpenPOWER on IntegriCloud