2021-05-20 15:05:51 +00:00
|
|
|
diff -ur b/at.c a/at.c
|
|
|
|
--- b/at.c 2021-04-25 03:31:30.000000000 +0200
|
|
|
|
+++ a/at.c 2021-05-21 12:51:48.123335137 +0200
|
2013-09-26 15:01:11 +00:00
|
|
|
@@ -62,11 +62,8 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2022-03-31 10:13:56 +00:00
|
|
|
|
2013-09-26 15:01:11 +00:00
|
|
|
-#ifdef TM_IN_SYS_TIME
|
|
|
|
#include <sys/time.h>
|
|
|
|
-#else
|
|
|
|
#include <time.h>
|
|
|
|
-#endif
|
2022-03-31 10:13:56 +00:00
|
|
|
|
2013-09-26 15:01:11 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
2021-05-20 15:05:51 +00:00
|
|
|
@@ -245,6 +242,12 @@
|
2013-09-26 15:01:11 +00:00
|
|
|
int kill_errno;
|
|
|
|
int rc;
|
|
|
|
int mailsize = 128;
|
|
|
|
+ struct timeval tv;
|
|
|
|
+ struct timezone tz;
|
|
|
|
+ long int i;
|
|
|
|
+
|
|
|
|
+ gettimeofday(&tv, &tz);
|
|
|
|
+ srandom(getpid()+tv.tv_usec);
|
2022-03-31 10:13:56 +00:00
|
|
|
|
2013-09-26 15:01:11 +00:00
|
|
|
/* Install the signal handler for SIGINT; terminate after removing the
|
|
|
|
* spool file if necessary
|
2021-05-20 15:05:51 +00:00
|
|
|
@@ -492,6 +495,9 @@
|
2013-09-26 15:01:11 +00:00
|
|
|
fprintf(fp, " || {\n\t echo 'Execution directory "
|
|
|
|
"inaccessible' >&2\n\t exit 1\n}\n");
|
2022-03-31 10:13:56 +00:00
|
|
|
|
2013-09-26 15:01:11 +00:00
|
|
|
+ i = random();
|
|
|
|
+ fprintf(fp, "${SHELL:-/bin/sh} << \'marcinDELIMITER%08lx\'\n", i);
|
|
|
|
+
|
|
|
|
istty = isatty(fileno(stdin));
|
|
|
|
if (istty) {
|
2021-05-20 15:05:51 +00:00
|
|
|
runtime = localtime(&runtimer);
|
|
|
|
@@ -512,7 +518,7 @@
|
2013-09-26 15:01:11 +00:00
|
|
|
if (istty) {
|
|
|
|
fprintf(stderr, "<EOT>\n");
|
|
|
|
}
|
|
|
|
- fprintf(fp, "\n");
|
2022-03-31 10:13:56 +00:00
|
|
|
+ fprintf(fp, "\nmarcinDELIMITER%08lx\n", i);
|
2013-09-26 15:01:11 +00:00
|
|
|
if (ferror(fp))
|
|
|
|
panic("Output error");
|
2016-07-01 08:43:48 +00:00
|
|
|
fflush(fp);
|
2021-05-20 15:05:51 +00:00
|
|
|
Only in a: .vscode
|