diff options
author | Chris PeBenito <pebenito@gentoo.org> | 2008-09-26 03:20:47 +0000 |
---|---|---|
committer | Chris PeBenito <pebenito@gentoo.org> | 2008-09-26 03:20:47 +0000 |
commit | 706d735bcaf96ca9105aad6b53fb3935cfaf86f8 (patch) | |
tree | d6c8c8d510b30d8cecea2f545eac2af7cb7f5389 /sys-process/vixie-cron | |
parent | Version bump (diff) | |
download | historical-706d735bcaf96ca9105aad6b53fb3935cfaf86f8.tar.gz historical-706d735bcaf96ca9105aad6b53fb3935cfaf86f8.tar.bz2 historical-706d735bcaf96ca9105aad6b53fb3935cfaf86f8.zip |
sys-process/vixie-cron: bump to update selinux patch.
Package-Manager: portage-2.2_rc9/cvs/Linux 2.6.24-gentoo-r3 x86_64
Diffstat (limited to 'sys-process/vixie-cron')
-rw-r--r-- | sys-process/vixie-cron/ChangeLog | 8 | ||||
-rw-r--r-- | sys-process/vixie-cron/Manifest | 14 | ||||
-rw-r--r-- | sys-process/vixie-cron/files/vixie-cron-4.1-selinux-1.diff | 144 | ||||
-rw-r--r-- | sys-process/vixie-cron/vixie-cron-4.1-r11.ebuild | 123 |
4 files changed, 277 insertions, 12 deletions
diff --git a/sys-process/vixie-cron/ChangeLog b/sys-process/vixie-cron/ChangeLog index c9c0167f5a09..9189696d3893 100644 --- a/sys-process/vixie-cron/ChangeLog +++ b/sys-process/vixie-cron/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-process/vixie-cron # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/ChangeLog,v 1.55 2008/09/21 06:29:32 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/ChangeLog,v 1.56 2008/09/26 03:20:47 pebenito Exp $ + +*vixie-cron-4.1-r11 (26 Sep 2008) + + 26 Sep 2008; Chris PeBenito <pebenito@gentoo.org> + +files/vixie-cron-4.1-selinux-1.diff, +vixie-cron-4.1-r11.ebuild: + Update SELinux patch for seuser support. 21 Sep 2008; Mike Frysinger <vapier@gentoo.org> vixie-cron-4.1-r10.ebuild: Drop bindnow-flags usage #212004 by Paweł Hajdan jr (ph). diff --git a/sys-process/vixie-cron/Manifest b/sys-process/vixie-cron/Manifest index 5bb93b3198a5..882feb632207 100644 --- a/sys-process/vixie-cron/Manifest +++ b/sys-process/vixie-cron/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX cron.pam.d 123 RMD160 38def0a49d4a1093cb9812300c7cfe51ee7b5110 SHA1 f467b316486d9b49df68663b763991286384611f SHA256 dba1c0db92936b0a0528ac2d86610b3d46102f02c87f19a97a8af002a4132901 AUX crontab 603 RMD160 25bba6bd718d39e203a65def0786e5daf14e9786 SHA1 5cf10ef54e71cbcb45d24087fd5f4a4adfa83901 SHA256 952454e79a4a7c0942fe572110c0f057bbba445cfe02f3853f77bf4722241a2c AUX crontab-3.0.1-r4 616 RMD160 f99414b8ee4889e9d01da45ef5cb6b7cda220ba2 SHA1 6df5739de93fd492f730e0e8f58a1b540c518776 SHA256 256ed999f39dcf1b5cadc0e4ceb299410e81080919f9aa28f5fbaeecee904798 @@ -11,19 +8,14 @@ AUX vixie-cron-4.1-commandline.patch 387 RMD160 087955328100c9fd3fd34b1151c91c63 AUX vixie-cron-4.1-cron.deny 220 RMD160 b44d5d9e8a228897ede96fd6dd332b07b65ab58a SHA1 4ed2260fb13bb6835806c75e5826df88890271cd SHA256 3e32d9d1bcb012f773fa7674f5d672af2539db5bda8878741873bbcc599678ff AUX vixie-cron-4.1-hardlink.patch 369 RMD160 0bbdfb763c652b5246fa72d5bce117a95e6237ce SHA1 dcfd32263a8e085d898c5bdd55ccd3ed48fa5f51 SHA256 abce88d7f48f902baddf532a8c137b6d55a1157d04b179b3f18b19de70b030bd AUX vixie-cron-4.1-pam.patch 1714 RMD160 e8d6fe903d4559b9465b9735ef5f0d4c26dd7452 SHA1 122c90082e79e4547f6943d9d8af0c22ec6540df SHA256 7dbfc2aaa50ab7aff012e97306fa12a1751e96c42e3af0ae82b9659ab24e660e +AUX vixie-cron-4.1-selinux-1.diff 4680 RMD160 333750f36d3e2ab8fa8de546342bfa74bd7f80ce SHA1 5276458935452a96ae2763b45dd181d0f46ae757 SHA256 2270530663fd07d05af79684a4b43f91cf2fffb0fd2e43b69667649ae5e151c1 AUX vixie-cron-4.1-selinux.diff 3557 RMD160 992fd5baf2c3be4e1b477cc5e8870e58a391a3d2 SHA1 8595a62c5e22c81f962426318acbe6d8524b4e07 SHA256 2e5df441230bed3f7fef9c63bb730d43a6293f756b64ffae29f8b98daff64524 AUX vixie-cron-4.1-setuid_check.patch 767 RMD160 5c8289a4a698be422bf062e2a7e07126d5bf95b2 SHA1 69e7b581e221e1bd356e7553b16231e73a374675 SHA256 63722e28b0477f5c3195d919b6a46647b76be50c0192879e64fcd17e54882ed5 AUX vixie-cron.rc6 530 RMD160 d02cb06b6d90fb8dc2b8cd200b3a79e0921889dd SHA1 ce9dadf0c5993810224955d80107e1770366f1f2 SHA256 7bfb5a1461062cc1dd614940bf703fdfc4ab6a69bfae3ce83b6734a149771dc7 DIST vixie-cron-4.1-gentoo-r4.patch.bz2 4204 RMD160 1d439c0bb473e8307a5c33e2449efdd9ca6fc4f5 SHA1 074a770df7ff401f1442ae70039dd9023498e0d4 SHA256 8de14b11da567f7859df3dcf71802f32ac1b3650ae07c6cb6dbc259e1f6da7fc DIST vixie-cron-4.1.tar.bz2 54246 RMD160 a7f6aaa6deb9924d56da8dca3e2e323e0786f97e SHA1 d8b087c0e5f7a2a9c74e3400b660756ab6d800c9 SHA256 fd25119b301e0e8306ec27ee912298740c5c8ae879bac02381429cf355d1122d EBUILD vixie-cron-4.1-r10.ebuild 3433 RMD160 10ef6474903266d7c0763ee0418e97814625e5de SHA1 7ee8979b6af2fa7aee863f1e160c6d0bba8fe916 SHA256 6c86d9ca97c152ff2bdabc73c2295966def94b734061927582aa3dbec5c9f238 +EBUILD vixie-cron-4.1-r11.ebuild 3448 RMD160 4e2b0e012900dcaa3866b1f31aa0d43cdab9794e SHA1 dd15d005cf752660c93936126ed281fbcf5922bd SHA256 f6b9496269bdb8fd8ce94f5adc59a9db8c8328ca1763efacdca4cdb9ad656608 EBUILD vixie-cron-4.1-r9.ebuild 2811 RMD160 15cf7b6b6beefdf9b221aa86e84968c61a644df8 SHA1 68281c01bb3266c52c5a9092ff108328816c879b SHA256 55030d1375dc28d8b08155a9a52c330cd1db1ce956516a4298fdbbc2444ffa59 -MISC ChangeLog 20614 RMD160 6860fa2f2d019596b7d6906153a82699ad0fcb68 SHA1 16ee715cea6b9dcc5a01bdabc598bdd5ab336a7b SHA256 34d6cacb57a62013dd1286202fe0d61198e686c3b0029b1ed15ff181a49114f8 +MISC ChangeLog 20815 RMD160 c941801925d46242b8635f076fde097f221c0416 SHA1 686df9cc5e1d93bd8e4d637f20b5bcfd0098c4d6 SHA256 1c51634da8d1d948fc3d48c37064e81abdade666d49cd84a2ad6dbc3911a83ed MISC metadata.xml 158 RMD160 298878d8b5da225547b337739a1a48192546d7b8 SHA1 5a9f7a1c9f0f56d1b0e72ee9b67b5cc5771f6d7d SHA256 a262a73b2049a89ab6a4bdf51df27bea44c7f0aa0ee33176c59a9c63eb45e764 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.9 (GNU/Linux) - -iEYEARECAAYFAkjV6dIACgkQ67wieSYcaxcMAgCcCWjp33gRBKOakkR3+5rNUlra -NVwAn3Xador7RWY4j8wWRQuPVIf8sYFg -=P3Rx ------END PGP SIGNATURE----- diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-selinux-1.diff b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux-1.diff new file mode 100644 index 000000000000..536eb2b43000 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux-1.diff @@ -0,0 +1,144 @@ +diff -purN vixie-cron-4.1.orig/Makefile vixie-cron-4.1/Makefile +--- vixie-cron-4.1.orig/Makefile 2004-08-27 14:09:33.000000000 -0400 ++++ vixie-cron-4.1/Makefile 2008-08-25 15:17:20.062720415 -0400 +@@ -68,7 +68,8 @@ LINTFLAGS = -hbxa $(INCLUDE) $(DEBUGGING + #<<want to use a nonstandard CC?>> + CC = gcc -Wall -Wno-unused -Wno-comment + #<<manifest defines>> +-DEFS = ++DEFS = -s -DWITH_SELINUX ++LIBS += -lselinux + #(SGI IRIX systems need this) + #DEFS = -D_BSD_SIGNALS -Dconst= + #<<the name of the BSD-like install program>> +diff -purN vixie-cron-4.1.orig/database.c vixie-cron-4.1/database.c +--- vixie-cron-4.1.orig/database.c 2004-08-27 14:09:34.000000000 -0400 ++++ vixie-cron-4.1/database.c 2008-08-27 08:19:37.948930858 -0400 +@@ -28,6 +28,16 @@ static char rcsid[] = "$Id: database.c,v + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#include <selinux/flask.h> ++#include <selinux/av_permissions.h> ++#include <selinux/get_context_list.h> ++#define SYSUSERNAME "system_u" ++#else ++#define SYSUSERNAME "*system*" ++#endif ++ + #define TMAX(a,b) ((a)>(b)?(a):(b)) + + static void process_crontab(const char *, const char *, +@@ -183,7 +193,7 @@ process_crontab(const char *uname, const + if (fname == NULL) { + /* must be set to something for logging purposes. + */ +- fname = "*system*"; ++ fname = SYSUSERNAME; + } else if ((pw = getpwnam(uname)) == NULL) { + /* file doesn't have a user in passwd file. + */ +@@ -245,6 +255,56 @@ process_crontab(const char *uname, const + free_user(u); + log_it(fname, getpid(), "RELOAD", tabname); + } ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled()) { ++ security_context_t file_context=NULL; ++ security_context_t user_context=NULL; ++ struct av_decision avd; ++ int retval=0; ++ char *seuser=NULL; ++ char *level=NULL; ++ ++ if (fgetfilecon(crontab_fd, &file_context) < OK) { ++ log_it(fname, getpid(), "getfilecon FAILED", tabname); ++ goto next_crontab; ++ } ++ ++ /* ++ * Since crontab files are not directly executed, ++ * crond must ensure that the crontab file has ++ * a context that is appropriate for the context of ++ * the user cron job. It performs an entrypoint ++ * permission check for this purpose. ++ */ ++ if (getseuserbyname(fname, &seuser, &level) < 0) { ++ log_it(fname, getpid(), "NO SEUSER", tabname); ++ goto next_crontab; ++ } ++ ++ if (get_default_context_with_level(seuser, level, NULL, &user_context) < 0) { ++ log_it(fname, getpid(), "NO CONTEXT", tabname); ++ freecon(file_context); ++ free(seuser); ++ free(level); ++ goto next_crontab; ++ } ++ ++ retval = security_compute_av(user_context, ++ file_context, ++ SECCLASS_FILE, ++ FILE__ENTRYPOINT, ++ &avd); ++ freecon(user_context); ++ freecon(file_context); ++ free(seuser); ++ free(level); ++ ++ if (retval || ((FILE__ENTRYPOINT & avd.allowed) != FILE__ENTRYPOINT)) { ++ log_it(fname, getpid(), "ENTRYPOINT FAILED", tabname); ++ goto next_crontab; ++ } ++ } ++#endif + u = load_user(crontab_fd, pw, fname); + if (u != NULL) { + u->mtime = statbuf->st_mtime; +diff -purN vixie-cron-4.1.orig/do_command.c vixie-cron-4.1/do_command.c +--- vixie-cron-4.1.orig/do_command.c 2004-08-27 14:09:34.000000000 -0400 ++++ vixie-cron-4.1/do_command.c 2008-08-25 15:43:43.289174371 -0400 +@@ -25,6 +25,11 @@ static char rcsid[] = "$Id: do_command.c + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#include <selinux/get_context_list.h> ++#endif ++ + static void child_process(entry *, user *); + static int safe_p(const char *, const char *); + +@@ -265,6 +270,29 @@ child_process(entry *e, user *u) { + _exit(OK_EXIT); + } + # endif /*DEBUGGING*/ ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled()) { ++ char *seuser=NULL; ++ char *level=NULL; ++ security_context_t scontext; ++ ++ if (getseuserbyname(u->name, &seuser, &level) < 0) { ++ fprintf(stderr, "getseuserbyname: Could not determine seuser for user %s\n", u->name); ++ _exit(ERROR_EXIT); ++ } ++ if (get_default_context_with_level(seuser, level, NULL, &scontext) < 0) { ++ fprintf(stderr, "get_default_context_with_level: could not get security context for user %s, seuser %s\n", u->name, seuser); ++ _exit(ERROR_EXIT); ++ } ++ if (setexeccon(scontext) < 0) { ++ fprintf(stderr, "setexeccon: Could not set exec context to %s for user %s\n", scontext, u->name); ++ _exit(ERROR_EXIT); ++ } ++ free(seuser); ++ free(level); ++ freecon(scontext); ++ } ++#endif + execle(shell, shell, "-c", e->cmd, (char *)0, e->envp); + fprintf(stderr, "execl: couldn't exec `%s'\n", shell); + perror("execl"); diff --git a/sys-process/vixie-cron/vixie-cron-4.1-r11.ebuild b/sys-process/vixie-cron/vixie-cron-4.1-r11.ebuild new file mode 100644 index 000000000000..e1b8b02eecd6 --- /dev/null +++ b/sys-process/vixie-cron/vixie-cron-4.1-r11.ebuild @@ -0,0 +1,123 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/vixie-cron-4.1-r11.ebuild,v 1.1 2008/09/26 03:20:47 pebenito Exp $ + +inherit cron toolchain-funcs pam + +# no useful homepage, bug #65898 +HOMEPAGE="ftp://ftp.isc.org/isc/cron/" +DESCRIPTION="Paul Vixie's cron daemon, a fully featured crond implementation" + +SELINUX_PATCH="${P}-selinux-1.diff" +GENTOO_PATCH_REV="r4" + +SRC_URI="mirror://gentoo/${P}.tar.bz2 + mirror://gentoo/${P}-gentoo-${GENTOO_PATCH_REV}.patch.bz2" + +LICENSE="as-is" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="selinux pam debug" + +DEPEND="selinux? ( sys-libs/libselinux ) + pam? ( virtual/pam )" + +RDEPEND="selinux? ( sys-libs/libselinux ) + pam? ( virtual/pam )" + +#vixie-cron supports /etc/crontab +CRON_SYSTEM_CRONTAB="yes" + +pkg_setup() { + enewgroup crontab +} + +src_unpack() { + unpack ${A} + cd ${S} + + epatch ${WORKDIR}/${P}-gentoo-${GENTOO_PATCH_REV}.patch + epatch ${FILESDIR}/crontab.5.diff + epatch ${FILESDIR}/${P}-commandline.patch + epatch ${FILESDIR}/${P}-basename.diff + epatch ${FILESDIR}/${P}-setuid_check.patch + epatch ${FILESDIR}/${P}-hardlink.patch + + use pam && epatch ${FILESDIR}/${P}-pam.patch + use selinux && epatch ${FILESDIR}/${SELINUX_PATCH} +} + +src_compile() { + use debug && append-flags -DDEBUGGING + + sed -i -e "s:gcc \(-Wall.*\):$(tc-getCC) \1 ${CFLAGS}:" \ + -e "s:^\(LDFLAGS[ \t]\+=\).*:\1 ${LDFLAGS}:" Makefile \ + || die "sed Makefile failed" + + emake || die "emake failed" +} + +src_install() { + docrondir -m 1730 -o root -g crontab + docron + docrontab -m 2755 -o root -g crontab + + # /etc stuff + insinto /etc + newins ${FILESDIR}/crontab-3.0.1-r4 crontab + newins ${FILESDIR}/${P}-cron.deny cron.deny + + keepdir /etc/cron.d + newpamd ${FILESDIR}/pamd.compatible cron + newinitd ${FILESDIR}/vixie-cron.rc6 vixie-cron + + # doc stuff + doman crontab.1 crontab.5 cron.8 + dodoc ${FILESDIR}/crontab + dodoc CHANGES CONVERSION FEATURES MAIL README THANKS +} + +pkg_preinst() { + has_version "<${CATEGORY}/${PN}-4.1-r10" + fix_spool_dir_perms=$? +} + +pkg_postinst() { + if [[ -f ${ROOT}/etc/init.d/vcron ]] + then + ewarn "Please run:" + ewarn "rc-update del vcron" + ewarn "rc-update add vixie-cron default" + fi + + # bug 71326 + if [[ -u ${ROOT}/etc/pam.d/cron ]] ; then + echo + ewarn "Warning: previous ebuilds didn't reset permissions prior" + ewarn "to installing crontab, resulting in /etc/pam.d/cron being" + ewarn "installed with the SUID and executable bits set." + ewarn + ewarn "Run the following as root to set the proper permissions:" + ewarn " chmod 0644 /etc/pam.d/cron" + echo + fi + + # bug 164466 + if [[ $fix_spool_dir_perms = 0 ]] ; then + echo + ewarn "Previous ebuilds didn't correctly set permissions on" + ewarn "the crontabs spool directory. Proper permissions are" + ewarn "now being set on ${ROOT}var/spool/cron/crontabs/" + ewarn "Look at this directory if you have a specific configuration" + ewarn "that needs special ownerships or permissions." + echo + chmod 1730 "${ROOT}/var/spool/cron/crontabs" || die "chmod failed" + chgrp -R crontab "${ROOT}/var/spool/cron/crontabs" || die "chgrp failed" + cd "${ROOT}/var/spool/cron/crontabs/" + for cronfile in * ; do + [[ ! -f $cronfile ]] || chown "$cronfile:crontab" "$cronfile" \ + || ewarn "chown failed on $cronfile, you probably have an orphan file." + done + fi + + cron_pkg_postinst +} |