Commit dd50c085 authored by Julien Muchembled's avatar Julien Muchembled

version up: dcron 4.5

parent 97fc9194
......@@ -9,17 +9,17 @@ parts = dcron-output
[dcron]
recipe = slapos.recipe.cmmi
shared = false
url = http://www.jimpryor.net/linux/releases/dcron-4.4.tar.gz
md5sum = 02d848ba043a9df5bf2102a9f4bc04bd
url = http://www.jimpryor.net/linux/releases/dcron-4.5.tar.gz
md5sum = 078833f3281f96944fc30392b1888326
configure-command = true
patch-binary = ${patch:location}/bin/patch
patches =
${:_profile_base_location_}/dcron-4.4.noroot.no.globals.patch#d5408ab682b65cc1eda40d588fcd7db8
${:_profile_base_location_}/noroot-no-globals.patch#623379916f48bd8292a28057c8bd30f7
patch-options = -p1
make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
post-make-hook = ${:_profile_base_location_}/dcron-hooks.py#d7985eef1ceef01af00ffb1d38708c8d:post_make_hook
environment =
PATH=${patch:location}/bin:%(PATH)s
post-install =
chmod u-s %(location)s/bin/crontab
dummy = ${randomsleep:recipe}
[dcron-output]
......
import os
import shutil
def post_make_hook(options, buildout):
crontab_path = os.path.join(options['location'], 'bin', 'crontab')
os.chmod(crontab_path, 0o750)
diff -ru dcron-4.4.org/chuser.c dcron-4.4/chuser.c
--- dcron-4.4.org/chuser.c 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/chuser.c 2013-07-18 18:17:16.342147418 +0200
@@ -14,47 +14,6 @@
--- dcron-4.5/chuser.c
+++ dcron-4.5/chuser.c
@@ -14,6 +14,7 @@
int
ChangeUser(const char *user, char *dochdir)
{
- struct passwd *pas;
-
- /*
- * Obtain password entry and change privilages
- */
-
- if ((pas = getpwnam(user)) == 0) {
- printlogf(LOG_ERR, "failed to get uid for %s\n", user);
- return(-1);
- }
- setenv("USER", pas->pw_name, 1);
- setenv("HOME", pas->pw_dir, 1);
- setenv("SHELL", "/bin/sh", 1);
-
- /*
- * Change running state to the user in question
- */
-
- if (initgroups(user, pas->pw_gid) < 0) {
- printlogf(LOG_ERR, "initgroups failed: %s %s\n", user, strerror(errno));
- return(-1);
- }
- if (setregid(pas->pw_gid, pas->pw_gid) < 0) {
- printlogf(LOG_ERR, "setregid failed: %s %d\n", user, pas->pw_gid);
- return(-1);
- }
- if (setreuid(pas->pw_uid, pas->pw_uid) < 0) {
- printlogf(LOG_ERR, "setreuid failed: %s %d\n", user, pas->pw_uid);
- return(-1);
- }
- if (dochdir) {
- /* try to change to $HOME */
- if (chdir(pas->pw_dir) < 0) {
- printlogf(LOG_ERR, "chdir failed: %s %s\n", user, pas->pw_dir);
- /* dochdir is a backup directory, usually /tmp */
- if (chdir(dochdir) < 0) {
- printlogf(LOG_ERR, "chdir failed: %s %s\n", user, dochdir);
- return(-1);
- }
- }
- }
- return(pas->pw_uid);
+ return getpwnam(user);
+#if 0
struct passwd *pas;
/*
@@ -57,5 +58,8 @@
}
}
return(pas->pw_uid);
+#else
+ return getpwnam(user);
+#endif
}
diff -ru dcron-4.4.org/crontab.c dcron-4.4/crontab.c
--- dcron-4.4.org/crontab.c 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/crontab.c 2013-07-18 18:18:07.768535485 +0200
--- dcron-4.5/crontab.c
+++ dcron-4.5/crontab.c
@@ -88,7 +88,7 @@
break;
case 'c':
......@@ -81,9 +47,8 @@ diff -ru dcron-4.4.org/crontab.c dcron-4.4/crontab.c
if ((ptr = getenv("EDITOR")) == NULL || strlen(ptr) >= sizeof(visual))
if ((ptr = getenv("VISUAL")) == NULL || strlen(ptr) >= sizeof(visual))
ptr = PATH_VI;
diff -ru dcron-4.4.org/job.c dcron-4.4/job.c
--- dcron-4.4.org/job.c 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/job.c 2013-07-18 18:17:16.342147418 +0200
--- dcron-4.5/job.c
+++ dcron-4.5/job.c
@@ -62,14 +62,6 @@
* Change running state to the user in question
*/
......@@ -114,9 +79,8 @@ diff -ru dcron-4.4.org/job.c dcron-4.4/job.c
/* from this point we are unpriviledged */
/*
diff -ru dcron-4.4.org/Makefile dcron-4.4/Makefile
--- dcron-4.4.org/Makefile 2010-01-18 16:27:31.000000000 +0100
+++ dcron-4.4/Makefile 2013-07-18 18:17:16.342147418 +0200
--- dcron-4.5/Makefile
+++ dcron-4.5/Makefile
@@ -3,7 +3,6 @@
# these variables can be configured by e.g. `make SCRONTABS=/different/path`
......@@ -137,9 +101,9 @@ diff -ru dcron-4.4.org/Makefile dcron-4.4/Makefile
+INSTALL_DATA = $(INSTALL) -D -m0644
+INSTALL_DIR = $(INSTALL) -d -m0755
CFLAGS ?= -O2
CFLAGS += -Wall -Wstrict-prototypes
CFLAGS += -Wall -Wstrict-prototypes -Wno-missing-field-initializers
SRCS = main.c subs.c database.c job.c concat.c chuser.c
@@ -44,7 +43,6 @@
@@ -45,7 +44,6 @@
echo "SBINDIR = $(SBINDIR)" >> config
echo "BINDIR = $(BINDIR)" >> config
echo "MANDIR = $(MANDIR)" >> config
......@@ -147,8 +111,8 @@ diff -ru dcron-4.4.org/Makefile dcron-4.4/Makefile
echo "SCRONTABS = $(SCRONTABS)" >> config
echo "CRONTABS = $(CRONTABS)" >> config
echo "CRONSTAMPS = $(CRONSTAMPS)" >> config
@@ -62,13 +60,10 @@
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $< -o $@
@@ -63,13 +61,10 @@
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(DEFS) $< -o $@
install:
- $(INSTALL_PROGRAM) -m0700 -g root crond $(DESTDIR)$(SBINDIR)/crond
......
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