9ccead
diff -up at-3.1.10/at.c.filter-environment at-3.1.10/at.c
9ccead
--- at-3.1.10/at.c.filter-environment	2014-10-02 10:21:01.684890331 +0200
9ccead
+++ at-3.1.10/at.c	2014-10-02 10:21:40.678770635 +0200
9ccead
@@ -388,6 +388,22 @@ writefile(time_t runtimer, char queue)
9ccead
 	int export = 1;
9ccead
 	char *eqp;
9ccead
 
9ccead
+        /* Only accept alphanumerics and underscore in variable names.
9ccead
+         * Also require the name to not start with a digit.
9ccead
+         * Some shells don't like other variable names.
9ccead
+         */
9ccead
+        {
9ccead
+            char *p = *atenv;
9ccead
+            if (isdigit(*p))
9ccead
+                export = 0;
9ccead
+            for (; *p != '=' && *p != '\0'; ++p) {
9ccead
+                if (!isalnum(*p) && *p != '_') {
9ccead
+                    export = 0;
9ccead
+                    break;
9ccead
+                }
9ccead
+            }
9ccead
+        }
9ccead
+
9ccead
 	eqp = strchr(*atenv, '=');
9ccead
 	if (ap == NULL)
9ccead
 	    eqp = *atenv;