Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Takoudjou
slapos
Commits
dd50c085
Commit
dd50c085
authored
May 21, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version up: dcron 4.5
parent
97fc9194
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
71 deletions
+30
-71
component/dcron/buildout.cfg
component/dcron/buildout.cfg
+6
-6
component/dcron/dcron-hooks.py
component/dcron/dcron-hooks.py
+0
-5
component/dcron/noroot-no-globals.patch
component/dcron/noroot-no-globals.patch
+24
-60
No files found.
component/dcron/buildout.cfg
View file @
dd50c085
...
...
@@ -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 = 0
2d848ba043a9df5bf2102a9f4bc04bd
url = http://www.jimpryor.net/linux/releases/dcron-4.
5
.tar.gz
md5sum = 0
78833f3281f96944fc30392b1888326
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]
...
...
component/dcron/dcron-hooks.py
deleted
100644 → 0
View file @
97fc9194
import
os
import
shutil
def
post_make_hook
(
options
,
buildout
):
crontab_path
=
os
.
path
.
join
(
options
[
'location'
],
'bin'
,
'crontab'
)
os
.
chmod
(
crontab_path
,
0o750
)
component/dcron/
dcron-4.4.noroot.no.
globals.patch
→
component/dcron/
noroot-no-
globals.patch
View file @
dd50c085
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);
+#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
@@ -4
4,7 +43
,6 @@
@@ -4
5,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
@@ -6
2,13 +60
,10 @@
$(CC)
-c $(CPPFLAGS) $(CFLAGS)
$(DEFS) $< -o $@
@@ -6
3,13 +61
,10 @@
$(CC)
$(CFLAGS) $(CPPFLAGS) -c
$(DEFS) $< -o $@
install:
- $(INSTALL_PROGRAM) -m0700 -g root crond $(DESTDIR)$(SBINDIR)/crond
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment