Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Sep 2014 23:51:44 +0200
From:      Mateusz Guzik <mjguzik@gmail.com>
To:        Xin LI <delphij@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r272288 - head/usr.bin/at
Message-ID:  <20140929215143.GA17622@dft-labs.eu>
In-Reply-To: <201409292145.s8TLjvr5059566@svn.freebsd.org>
References:  <201409292145.s8TLjvr5059566@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 29, 2014 at 09:45:57PM +0000, Xin LI wrote:
> Author: delphij
> Date: Mon Sep 29 21:45:57 2014
> New Revision: 272288
> URL: http://svnweb.freebsd.org/changeset/base/272288
> 
> Log:
>   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
> 
> Modified:
>   head/usr.bin/at/at.c
> 
> Modified: head/usr.bin/at/at.c
> ==============================================================================
> --- head/usr.bin/at/at.c	Mon Sep 29 19:54:17 2014	(r272287)
> +++ head/usr.bin/at/at.c	Mon Sep 29 21:45:57 2014	(r272288)
> @@ -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);

Should not this line also be removed?

>  	    fputc('\n', fp);
>  	    
> 

-- 
Mateusz Guzik <mjguzik gmail.com>



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