diff --git a/calendar-1.35-linux.patch b/calendar-1.35-linux.patch new file mode 100644 index 0000000..f4739e1 --- /dev/null +++ b/calendar-1.35-linux.patch @@ -0,0 +1,153 @@ +diff -up calendar-1.35-20180719cvs/calendar.c.orig calendar-1.35-20180719cvs/calendar.c +--- calendar-1.35-20180719cvs/calendar.c.orig 2015-12-07 13:46:35.000000000 -0500 ++++ calendar-1.35-20180719cvs/calendar.c 2018-07-19 16:31:24.329101913 -0400 +@@ -35,7 +35,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -190,10 +189,6 @@ main(int argc, char *argv[]) + case 0: /* child */ + (void)setpgid(getpid(), getpid()); + (void)setlocale(LC_ALL, ""); +- if (setusercontext(NULL, pw, pw->pw_uid, +- LOGIN_SETALL ^ LOGIN_SETLOGIN)) +- err(1, "unable to set user context (uid %u)", +- pw->pw_uid); + if (acstat) { + if (chdir(pw->pw_dir) || + stat(calendarFile, &sbuf) != 0 || +diff -up calendar-1.35-20180719cvs/calendar.h.orig calendar-1.35-20180719cvs/calendar.h +--- calendar-1.35-20180719cvs/calendar.h.orig 2015-12-07 13:46:35.000000000 -0500 ++++ calendar-1.35-20180719cvs/calendar.h 2018-07-19 16:32:18.422927654 -0400 +@@ -29,6 +29,7 @@ + * SUCH DAMAGE. + */ + ++#include + + extern struct passwd *pw; + extern int doall; +@@ -116,7 +117,7 @@ extern int f_SetdayAfter; /* calendar in + + /* calendars */ + extern enum calendars { GREGORIAN = 0, JULIAN, LUNAR } calendar; +-extern u_long julian; ++extern unsigned long julian; + + #define NUMEV 3 /* Total number of such special events */ + extern struct specialev spev[NUMEV]; +@@ -126,3 +127,5 @@ extern struct specialev spev[NUMEV]; + * (e.g. by using named pipes) + */ + #define USERTIMEOUT 20 ++ ++#define SECSPERDAY 86400 +diff -up calendar-1.35-20180719cvs/day.c.orig calendar-1.35-20180719cvs/day.c +--- calendar-1.35-20180719cvs/day.c.orig 2016-09-14 11:09:46.000000000 -0400 ++++ calendar-1.35-20180719cvs/day.c 2018-07-19 16:33:28.708701235 -0400 +@@ -160,7 +160,7 @@ settime(time_t *now) + tp->tm_isdst = 0; + tp->tm_hour = 12; + *now = mktime(tp); +- if (isleap(tp->tm_year + 1900)) ++ if (__isleap(tp->tm_year + 1900)) + cumdays = daytab[1]; + else + cumdays = daytab[0]; +@@ -288,8 +288,10 @@ isnow(char *endp, int bodun) + return (NULL); + + /* adjust bodun rate */ +- if (bodun && !bodun_always) +- bodun = !arc4random_uniform(3); ++ if (bodun && !bodun_always) { ++ srandom(3); ++ bodun = random(); ++ } + + /* Easter or Easter depending days */ + if (flags & F_SPECIAL) +@@ -440,7 +442,7 @@ isnow(char *endp, int bodun) + } + v2 = day - tp->tm_yday; + if ((v2 > v1) || (v2 < 0)) { +- if ((v2 += isleap(tp->tm_year + 1900) ? 366 : 365) ++ if ((v2 += __isleap(tp->tm_year + 1900) ? 366 : 365) + <= v1) + tmtmp.tm_year++; + else if(!bodun || (day - tp->tm_yday) != -1) +@@ -670,7 +672,7 @@ variable_weekday(int *day, int month, in + int *cumdays; + int day1; + +- if (isleap(year)) ++ if (__isleap(year)) + cumdays = daytab[1]; + else + cumdays = daytab[0]; +diff -up calendar-1.35-20180719cvs/io.c.orig calendar-1.35-20180719cvs/io.c +--- calendar-1.35-20180719cvs/io.c.orig 2017-09-25 15:13:56.000000000 -0400 ++++ calendar-1.35-20180719cvs/io.c 2018-07-19 16:34:13.340557457 -0400 +@@ -67,7 +67,7 @@ void + cal(void) + { + int ch, l, i, bodun = 0, bodun_maybe = 0, var, printing; +- struct event *events, *cur_evt, *ev1, *tmp; ++ struct event *events = NULL, *cur_evt = NULL, *ev1 = NULL, *tmp = NULL; + char buf[2048 + 1], *prefix = NULL, *p; + struct match *m; + FILE *fp; +diff -up calendar-1.35-20180719cvs/ostern.c.orig calendar-1.35-20180719cvs/ostern.c +--- calendar-1.35-20180719cvs/ostern.c.orig 2015-03-14 20:41:28.000000000 -0400 ++++ calendar-1.35-20180719cvs/ostern.c 2018-07-19 16:34:30.896500902 -0400 +@@ -60,7 +60,7 @@ easter(int year) /* 0 ... abcd, NOT sinc + e_p = e_p + 1; + + e_q = 31 + 28 + e_p; +- if (isleap(year)) ++ if (__isleap(year)) + e_q++; + + if (e_n == 4) +diff -up calendar-1.35-20180719cvs/paskha.c.orig calendar-1.35-20180719cvs/paskha.c +--- calendar-1.35-20180719cvs/paskha.c.orig 2015-03-14 20:41:28.000000000 -0400 ++++ calendar-1.35-20180719cvs/paskha.c 2018-07-19 16:35:03.536395755 -0400 +@@ -27,6 +27,7 @@ + */ + + #include ++#include + + #include "calendar.h" + +@@ -47,7 +48,7 @@ paskha(int R) /*year*/ + d = (19*a + x) % 30; + e = (2*b + 4*c + 6*d + y) % 7; + cumdays = 31 + 28; +- if (isleap(R)) ++ if (__isleap(R)) + cumdays++; + return ((cumdays + 22) + (d + e) + 13); + } +diff -up calendar-1.35-20180719cvs/pesach.c.orig calendar-1.35-20180719cvs/pesach.c +--- calendar-1.35-20180719cvs/pesach.c.orig 2015-03-14 20:41:28.000000000 -0400 ++++ calendar-1.35-20180719cvs/pesach.c 2018-07-19 16:35:27.725317833 -0400 +@@ -18,6 +18,7 @@ + */ + + #include ++#include + + #include "calendar.h" + +@@ -61,5 +62,5 @@ pesach(int R) + if (R > 1582) + cumdays += R / 100 - R /400 - 2; + +- return (31 + 28 + cumdays + (isleap(R)? 1 : 0)); ++ return (31 + 28 + cumdays + (__isleap(R)? 1 : 0)); + }