head 1.2; access; symbols OPENPKG_E1_MP_HEAD:1.2 OPENPKG_E1_MP:1.2 OPENPKG_E1_MP_2_STABLE:1.2 OPENPKG_E1_FP:1.2 OPENPKG_2_STABLE_20061018:1.2 OPENPKG_2_STABLE:1.2.0.10 OPENPKG_2_STABLE_BP:1.2 OPENPKG_2_5_SOLID:1.2.0.8 OPENPKG_2_5_SOLID_BP:1.2 OPENPKG_2_4_RELEASE:1.2 OPENPKG_2_4_SOLID:1.2.0.6 OPENPKG_2_4_SOLID_BP:1.2 OPENPKG_2_3_RELEASE:1.2 OPENPKG_2_3_SOLID:1.2.0.4 OPENPKG_2_3_SOLID_BP:1.2 OPENPKG_2_2_RELEASE:1.2 OPENPKG_2_2_SOLID:1.2.0.2 OPENPKG_2_2_SOLID_BP:1.2 OPENPKG_0_0:1.1.1.1 OPENPKG:1.1.1; locks; strict; comment @# @; 1.2 date 2002.05.29.19.56.10; author rse; state dead; branches; next 1.1; 1.1 date 2001.09.18.09.48.32; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.09.18.09.48.32; author rse; state Exp; branches; next ; desc @@ 1.2 log @Finally rename all foo-X.Y.patch files to foo.patch in order to allow us to preserve history in CVS for patch files. @ text @diff -ru3 dcron-2.3.3.orig/database.c dcron-2.3.3/database.c --- dcron-2.3.3.orig/database.c Mon May 2 17:28:08 1994 +++ dcron-2.3.3/database.c Wed Jun 13 09:49:57 2001 @@@@ -179,7 +179,7 @@@@ if (--maxEntries == 0) break; - bzero(&line, sizeof(line)); + memset(&line, 0, sizeof(line)); if (DebugOpt) log9("User %s Entry %s\n", fileName, buf); diff -ru3 dcron-2.3.3.orig/defs.h dcron-2.3.3/defs.h --- dcron-2.3.3.orig/defs.h Fri Sep 5 21:44:32 1997 +++ dcron-2.3.3/defs.h Wed Jun 13 09:51:08 2001 @@@@ -21,12 +21,16 @@@@ #include #include #include +#include #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" diff -ru3 dcron-2.3.3.orig/main.c dcron-2.3.3/main.c --- dcron-2.3.3.orig/main.c Mon May 2 17:28:24 1994 +++ dcron-2.3.3/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); + } } /* diff -ru3 dcron-2.3.3.orig/subs.c dcron-2.3.3/subs.c --- dcron-2.3.3.orig/subs.c Mon Feb 16 20:35:10 1998 +++ dcron-2.3.3/subs.c Wed Jun 13 09:49:57 2001 @@@@ -15,7 +15,6 @@@@ Prototype int ChangeUser(const char *user, short dochdir); Prototype void vlog(int level, int fd, const char *ctl, va_list va); Prototype int slog(char *buf, size_t sz, const char *ctl, va_list va, short useDate); -Prototype char *strdup(const char *); void log9(const char *ctl, ...) @@@@ -80,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), sz - strlen(buf), ctl, va); return(strlen(buf)); } @@@@ -98,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 @@@@ -129,15 +134,5 @@@@ } } return(pas->pw_uid); -} - -char * -strdup(const char *str) -{ - char *ptr = malloc(strlen(str) + 1); - - if (ptr) - strcpy(ptr, str); - return(ptr); } @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import OpenPKG sources into CVS repository @ text @@