From owner-svn-src-stable-9@FreeBSD.ORG Thu Oct 2 18:32:18 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AF2EF7F; Thu, 2 Oct 2014 18:32:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26821D67; Thu, 2 Oct 2014 18:32:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s92IWIV1031402; Thu, 2 Oct 2014 18:32:18 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s92IWINC031401; Thu, 2 Oct 2014 18:32:18 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201410021832.s92IWINC031401@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 2 Oct 2014 18:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272439 - stable/9/usr.bin/at X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 18:32:18 -0000 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); }