svn commit: r272439 - stable/9/usr.bin/at

Xin LI delphij at FreeBSD.org
Thu Oct 2 18:32:18 UTC 2014


Author: delphij
Date: Thu Oct  2 18:32:17 2014
New Revision: 272439
URL: https://svnweb.freebsd.org/changeset/base/272439

Log:
  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)

Modified:
  stable/9/usr.bin/at/at.c
Directory Properties:
  stable/9/usr.bin/at/   (props changed)

Modified: stable/9/usr.bin/at/at.c
==============================================================================
--- stable/9/usr.bin/at/at.c	Thu Oct  2 18:26:40 2014	(r272438)
+++ stable/9/usr.bin/at/at.c	Thu Oct  2 18:32:17 2014	(r272439)
@@ -369,6 +369,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++)
 	    {
@@ -391,8 +392,6 @@ writefile(time_t runtimer, char queue)
 		    fputc(*ap, fp);
 		}
 	    }
-	    fputs("; export ", fp);
-	    fwrite(*atenv, sizeof(char), eqp-*atenv -1, fp);
 	    fputc('\n', fp);
 	    
 	}


More information about the svn-src-stable-9 mailing list