summaryrefslogtreecommitdiffstats
path: root/usr.bin/at
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-10-02 18:26:40 +0000
committerdelphij <delphij@FreeBSD.org>2014-10-02 18:26:40 +0000
commit28944a4ef0cb8062b8e9f2443c7fd3ded887391c (patch)
treef5d4ebe0c7543fed9580eaec62a1562435a16ffe /usr.bin/at
parentbcf511dc04a33e2174274d76ba703cb1d9a2d93e (diff)
downloadFreeBSD-src-28944a4ef0cb8062b8e9f2443c7fd3ded887391c.zip
FreeBSD-src-28944a4ef0cb8062b8e9f2443c7fd3ded887391c.tar.gz
MFC r272288,272289:
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) Approved by: re (gjb)
Diffstat (limited to 'usr.bin/at')
-rw-r--r--usr.bin/at/at.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 5f4500b..6e072d6 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,8 +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