You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
1.7 KiB

--- defs.h Fri Sep 5 21:44:32 1997
+++ defs.h Wed Jun 13 09:51:08 2001
@@ -21,12 +21,16 @@
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/resource.h>
+#include <sys/termios.h>
#define Prototype extern
#define arysize(ary) (sizeof(ary)/sizeof((ary)[0]))
#ifndef CRONTABS
#define CRONTABS "/var/spool/cron/crontabs"
+#endif
+#ifndef PIDFILE
+#define PIDFILE "/var/run/dcron.pid"
#endif
#ifndef TMPDIR
#define TMPDIR "/tmp"
--- main.c Mon May 2 17:28:24 1994
+++ main.c Wed Jun 13 09:53:09 2001
@@ -122,8 +122,14 @@
perror("fork");
exit(1);
}
- if (pid > 0)
+ if (pid > 0) {
+ FILE *fp;
+ if ((fp = fopen(PIDFILE, "w")) != NULL) {
+ fprintf(fp, "%d\n", pid);
+ fclose(fp);
+ }
exit(0);
+ }
}
/*
--- subs.c Wed Feb 10 07:31:46 1999
+++ subs.c Sun Feb 2 10:33:56 2003
@@ -79,7 +79,7 @@
buf[0] = 0;
if (useDate)
- strftime(buf, 128, "%d-%b-%y %H:%M ", tp);
+ strftime(buf, 128, "%d-%b-%Y %H:%M ", tp);
vsnprintf(buf + strlen(buf), nmax, ctl, va);
return(strlen(buf));
}
@@ -97,9 +97,15 @@
log(9, "failed to get uid for %s", user);
return(-1);
}
- setenv("USER", pas->pw_name, 1);
- setenv("HOME", pas->pw_dir, 1);
- setenv("SHELL", "/bin/sh", 1);
+ {
+ char buf[256];
+ snprintf(buf, sizeof(buf), "USER=%s", pas->pw_name);
+ putenv(buf);
+ snprintf(buf, sizeof(buf), "HOME=%s", pas->pw_dir);
+ putenv(buf);
+ snprintf(buf, sizeof(buf), "SHELL=%s", "/bin/sh");
+ putenv(buf);
+ }
/*
* Change running state to the user in question