Skip to content

Commit

Permalink
Merge pull request #132 from mobiwize/morty
Browse files Browse the repository at this point in the history
Fix cronie and OSTree conflicts
  • Loading branch information
EpicNuts authored Sep 11, 2017
2 parents 025bed3 + 12819a2 commit 9cf14ec
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/image_types_ostree.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ IMAGE_CMD_ostree () {
ln -sf var/rootdirs/home home
fi

# Move cron jobs if exist
if [ -d "var/spool/cron" ] && [ "$(ls -A var/spool/cron)" ] &&
[ -d "usr/share/cronie-spool" ] ; then
mv var/spool/cron/* usr/share/cronie-spool/
fi

# Move persistent directories to /var
dirs="opt mnt media srv"

Expand Down
9 changes: 9 additions & 0 deletions recipes-extended/cronie/cronie_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://Disable-hard-link-check-by-default.patch "
export SPOOL_DIR = "${datadir}/cronie-spool"
FILES_${PN} += "${datadir}/cronie-spool"

do_install_append () {
install -d ${D}${datadir}/cronie-spool/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 9ef211dcb89edbad605c49964faf302fb97b6ba9 Mon Sep 17 00:00:00 2001
From: Guy Shapiro <[email protected]>
Date: Thu, 24 Aug 2017 10:58:14 +0300
Subject: [PATCH] Disable hard link check by default

Without the "-p" flag, cronie does several checks on the
crontab files. Those checks prevent crontrab files from being
editable by unauthorized users.
One of those checks won't permit loading file that is
hard link count greater than 1.

When OSTree manages crontab file, it uses hard links.
All those user checks are irrelevant in the case embedded system, so
disable them by default.

Signed-off-by: Guy Shapiro <[email protected]>
---
crond.sysconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crond.sysconfig b/crond.sysconfig
index ee23703..1cb083f 100644
--- a/crond.sysconfig
+++ b/crond.sysconfig
@@ -1,3 +1,3 @@
# Settings for the CRON daemon.
# CRONDARGS= : any extra command-line startup arguments for crond
-CRONDARGS=
+CRONDARGS="-p"
--
2.1.4

0 comments on commit 9cf14ec

Please sign in to comment.