Commit 81529ee5 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

component/dcron: version up 4.5->4.6

parent 13d4b415
...@@ -8,12 +8,13 @@ parts = dcron-output ...@@ -8,12 +8,13 @@ parts = dcron-output
[dcron] [dcron]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = false shared = false
url = http://www.jimpryor.net/linux/releases/dcron-4.5.tar.gz url = https://github.com/ptchinster/dcron/archive/refs/tags/v4.6.zip
md5sum = 078833f3281f96944fc30392b1888326 md5sum = d5bd12863547daf499187bc9b4e863a8
configure-command = true configure-command = true
patch-binary = ${patch:location}/bin/patch patch-binary = ${patch:location}/bin/patch
patches = patches =
${:_profile_base_location_}/noroot-no-globals.patch#623379916f48bd8292a28057c8bd30f7 ${:_profile_base_location_}/noroot-no-globals.patch#cd8d0f6d1d2ee133d6341d1515832c0d
${:_profile_base_location_}/support_old_gcc.patch#4dc8c81b1d94474c3c15e0db7b5b60de
patch-options = -p1 patch-options = -p1
make-options = make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_} PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
......
--- dcron-4.5/chuser.c diff --git a/chuser.c b/chuser.c
+++ dcron-4.5/chuser.c index 0d79dbc..ccc3acc 100644
@@ -14,6 +14,7 @@ --- a/chuser.c
+++ b/chuser.c
@@ -11,6 +11,7 @@
Prototype int ChangeUser(const char *user, char *dochdir);
+#if 0
int int
ChangeUser(const char *user, char *dochdir) ChangeUser(const char *user, char *dochdir)
{ {
+#if 0 @@ -57,5 +58,7 @@ ChangeUser(const char *user, char *dochdir)
struct passwd *pas;
/*
@@ -57,5 +58,8 @@
} }
} }
return(pas->pw_uid); return(pas->pw_uid);
+#else
+ return getpwnam(user); + return getpwnam(user);
+#endif
} }
+#endif
--- dcron-4.5/crontab.c diff --git a/crontab.c b/crontab.c
+++ dcron-4.5/crontab.c index b29e0d2..06df70f 100644
@@ -88,7 +88,7 @@ --- a/crontab.c
+++ b/crontab.c
@@ -88,7 +88,7 @@ main(int ac, char **av)
break; break;
case 'c': case 'c':
/* getopt guarantees optarg != 0 here */ /* getopt guarantees optarg != 0 here */
...@@ -27,8 +30,8 @@ ...@@ -27,8 +30,8 @@
+ if (*optarg != 0) { + if (*optarg != 0) {
CDir = optarg; CDir = optarg;
} else { } else {
printlogf(0, "-c option: superuser only"); printlogf(0, "-c option: superuser only\n");
@@ -316,9 +316,6 @@ @@ -318,9 +318,6 @@ GetReplaceStream(const char *user, const char *file)
close(filedes[0]); close(filedes[0]);
...@@ -38,7 +41,7 @@ ...@@ -38,7 +41,7 @@
fd = open(file, O_RDONLY); fd = open(file, O_RDONLY);
if (fd < 0) { if (fd < 0) {
printlogf(0, "unable to open %s: %s", file, strerror(errno)); printlogf(0, "unable to open %s: %s", file, strerror(errno));
@@ -344,8 +341,6 @@ @@ -346,8 +343,6 @@ EditFile(const char *user, const char *file)
const char *ptr; const char *ptr;
char visual[SMALL_BUFFER]; char visual[SMALL_BUFFER];
...@@ -47,9 +50,11 @@ ...@@ -47,9 +50,11 @@
if ((ptr = getenv("EDITOR")) == NULL || strlen(ptr) >= sizeof(visual)) if ((ptr = getenv("EDITOR")) == NULL || strlen(ptr) >= sizeof(visual))
if ((ptr = getenv("VISUAL")) == NULL || strlen(ptr) >= sizeof(visual)) if ((ptr = getenv("VISUAL")) == NULL || strlen(ptr) >= sizeof(visual))
ptr = PATH_VI; ptr = PATH_VI;
--- dcron-4.5/job.c diff --git a/job.c b/job.c
+++ dcron-4.5/job.c index b5e02de..79650c2 100644
@@ -62,14 +62,6 @@ --- a/job.c
+++ b/job.c
@@ -63,14 +63,6 @@ RunJob(CronFile *file, CronLine *line)
* Change running state to the user in question * Change running state to the user in question
*/ */
...@@ -64,7 +69,7 @@ ...@@ -64,7 +69,7 @@
/* from this point we are unpriviledged */ /* from this point we are unpriviledged */
if (DebugOpt) if (DebugOpt)
@@ -295,14 +287,6 @@ @@ -296,14 +288,6 @@ EndJob(CronFile *file, CronLine *line, int exit_status)
* by the mailing and we already verified the mail file. * by the mailing and we already verified the mail file.
*/ */
...@@ -79,9 +84,11 @@ ...@@ -79,9 +84,11 @@
/* from this point we are unpriviledged */ /* from this point we are unpriviledged */
/* /*
--- dcron-4.5/Makefile diff --git a/Makefile b/Makefile
+++ dcron-4.5/Makefile index 547febc..13829e6 100644
@@ -3,7 +3,6 @@ --- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@ VERSION = 4.5
# these variables can be configured by e.g. `make SCRONTABS=/different/path` # these variables can be configured by e.g. `make SCRONTABS=/different/path`
PREFIX = /usr/local PREFIX = /usr/local
...@@ -89,7 +96,7 @@ ...@@ -89,7 +96,7 @@
SCRONTABS = /etc/cron.d SCRONTABS = /etc/cron.d
CRONTABS = /var/spool/cron/crontabs CRONTABS = /var/spool/cron/crontabs
CRONSTAMPS = /var/spool/cron/cronstamps CRONSTAMPS = /var/spool/cron/cronstamps
@@ -20,10 +19,10 @@ @@ -20,10 +19,10 @@ MANDIR = $(PREFIX)/share/man
SHELL = /bin/sh SHELL = /bin/sh
...@@ -101,9 +108,9 @@ ...@@ -101,9 +108,9 @@
+INSTALL_DATA = $(INSTALL) -D -m0644 +INSTALL_DATA = $(INSTALL) -D -m0644
+INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755
CFLAGS ?= -O2 CFLAGS ?= -O2
CFLAGS += -Wall -Wstrict-prototypes -Wno-missing-field-initializers CFLAGS += -Wall -Wextra -Wstrict-prototypes -Wno-missing-field-initializers -Wfloat-equal -fstack-protector-all -Wformat-security -Wformat=2 -fPIE
SRCS = main.c subs.c database.c job.c concat.c chuser.c CFLAGS += -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,noexecheap -Wl,-z,relro -Wl,-z,now -Wl,-z,nodlopen -Wl,-z,-pie
@@ -45,7 +44,6 @@ @@ -47,7 +46,6 @@ all: $(PROTOS) crond crontab ;
echo "SBINDIR = $(SBINDIR)" >> config echo "SBINDIR = $(SBINDIR)" >> config
echo "BINDIR = $(BINDIR)" >> config echo "BINDIR = $(BINDIR)" >> config
echo "MANDIR = $(MANDIR)" >> config echo "MANDIR = $(MANDIR)" >> config
...@@ -111,7 +118,7 @@ ...@@ -111,7 +118,7 @@
echo "SCRONTABS = $(SCRONTABS)" >> config echo "SCRONTABS = $(SCRONTABS)" >> config
echo "CRONTABS = $(CRONTABS)" >> config echo "CRONTABS = $(CRONTABS)" >> config
echo "CRONSTAMPS = $(CRONSTAMPS)" >> config echo "CRONSTAMPS = $(CRONSTAMPS)" >> config
@@ -63,13 +61,10 @@ @@ -65,13 +63,10 @@ crontab: $(TABOBJS)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@ $(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@
install: install:
......
diff --git a/main.c b/main.c
diff --git a/main.c b/main.c
index dcf3f23..3eb6332 100644
--- a/main.c
+++ b/main.c
@@ -130,7 +130,7 @@ main(int ac, char **av)
case 'd':
DebugOpt = 1;
LogLevel = LOG_DEBUG;
- [[fallthrough]]; //fall through to include f too
+ __attribute__((fallthrough)); //fall through to include f too
case 'f':
ForegroundOpt = 1;
break;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment