Blame SOURCES/at-3.1.10-filter-environment.patch

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