summaryrefslogtreecommitdiff
path: root/usr.bin/at
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-09-29 21:45:57 +0000
committerXin LI <delphij@FreeBSD.org>2014-09-29 21:45:57 +0000
commitda9c3bbbeecad41ea804d803c625e7e0e65448ad (patch)
tree47a54901d237a471c4e0805c2dad4f7a0600f881 /usr.bin/at
parentcf3c0c32d21adb95971a1cc1b5e2ca5ef4ff268f (diff)
downloadsrc-test2-da9c3bbbeecad41ea804d803c625e7e0e65448ad.tar.gz
src-test2-da9c3bbbeecad41ea804d803c625e7e0e65448ad.zip
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
Notes
Notes: svn path=/head/; revision=272288
Diffstat (limited to 'usr.bin/at')
-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 5f4500ba343b..18367dd1372e 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);