Forgot patch.

This commit is contained in:
Marcela Mašláňová 2009-02-26 13:46:29 +00:00
parent 8c5d8c51ac
commit 26a0a82e64

View File

@ -0,0 +1,40 @@
diff -up at-3.1.10/at.c.fix at-3.1.10/at.c
--- at-3.1.10/at.c.fix 2009-02-26 14:31:55.000000000 +0100
+++ at-3.1.10/at.c 2009-02-26 14:37:49.000000000 +0100
@@ -61,12 +61,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#ifdef TM_IN_SYS_TIME
-#include <sys/time.h>
-#else
#include <time.h>
-#endif
+#include <sys/time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -244,6 +240,12 @@ writefile(time_t runtimer, char queue)
int kill_errno;
int rc;
int mailsize = 128;
+ struct timeval tv;
+ struct timezone tz;
+ int i;
+
+ gettimeofday(&tv, &tz);
+ srandom(getpid()+tv.tv_usec);
/* Install the signal handler for SIGINT; terminate after removing the
* spool file if necessary
@@ -455,7 +457,8 @@ writefile(time_t runtimer, char queue)
fprintf(fp, " || {\n\t echo 'Execution directory "
"inaccessible' >&2\n\t exit 1\n}\n");
- fprintf(fp, "${SHELL:-/bin/sh} << `(dd if=/dev/urandom count=200 bs=1 2>/dev/null|LC_ALL=C tr -d -c '[:alnum:]')`\n\n");
+ i = random();
+ fprintf(fp, "${SHELL:-/bin/sh} << marcinDELIMITER%x\nmarcinDELIMITER%x\n", i,i);
istty = isatty(fileno(stdin));
if (istty) {