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