Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Oct 2014 18:26:41 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r272438 - stable/10/usr.bin/at
Message-ID:  <201410021826.s92IQf0U027108@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Oct  2 18:26:40 2014
New Revision: 272438
URL: https://svnweb.freebsd.org/changeset/base/272438

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)
  Approved by:	re (gjb)

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

Modified: stable/10/usr.bin/at/at.c
==============================================================================
--- stable/10/usr.bin/at/at.c	Thu Oct  2 18:23:53 2014	(r272437)
+++ stable/10/usr.bin/at/at.c	Thu Oct  2 18:26:40 2014	(r272438)
@@ -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);
 	    
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410021826.s92IQf0U027108>