diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-process/vixie-cron |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-process/vixie-cron')
20 files changed, 1032 insertions, 0 deletions
diff --git a/sys-process/vixie-cron/Manifest b/sys-process/vixie-cron/Manifest new file mode 100644 index 000000000000..497a066a5c36 --- /dev/null +++ b/sys-process/vixie-cron/Manifest @@ -0,0 +1,23 @@ +AUX crontab 488 SHA256 524b108b3758436c935e4f840389abe861e8ea644d0774024aad5145424a911a SHA512 adf8335c4742aea39f825e21475959e638b0926cf557f20aefa93efa1291145ef4e44ec9e4fa0f0d6358c65d2c2b6b411deb4d4ac1dcc811085851910fb8c071 WHIRLPOOL 5cd5b076434f316701520a3405cc4f6f3cec2fdcd34031ac8436f836a62a57bc6b17d0672427eb956e3d40cea7952bb8d84135d10d38890f73ac099206e4dcc6 +AUX crontab-3.0.1-r4 489 SHA256 ad81688a4e22d70b0c9dc332f1390c6350b4d65be53ee4b51bc911b25f06b883 SHA512 6387680385c0f75a77a939592a9eb0f6ed30de20f262597875c64847d480a54854c4810001b7872fa769a7f9c45fa3045b2179744efad78fd80a4e8a3f4f326d WHIRLPOOL 32a351a13aecb9ea1badc64a0d92216dc104a175c7042c7ac308f6b1b90f94ce04fbb25689dba644ba4e7692029344fe4c3d6418e92f755b2966867a9b3232be +AUX crontab.5.diff 772 SHA256 24bac83157b5eb0e559ad8e536986019099d97d6f636fd8d655054a0219ec0f3 SHA512 2efecff5b35f06ccd65961143c55d8c4be92714c67de6c064b1d3b6975ef9d825c3f4b1b4c32c64efede2a8aa727bb4b22330ac45118f0e2b0feb6b169dfb17d WHIRLPOOL e928aa0bc23436d08eef53cfdef0f05bf27ce1fa1d563ea84382bc7edb6469f3a06ca2c023faafb6b03b83760003cdd8125fa0473d40f316829d02845e2ba176 +AUX pamd.compatible 123 SHA256 35940dd36bf0332b1a57d44d3f2f6cc7489c262119c69f8b1329f559a03177a2 SHA512 ea770adf46e00c0d517333f9c072946300db88e53fa7379616f499b6e771a24b0514bd85e24272b16a9dd4599b04514c557519ecb6d51f2ad752b7326376c62b WHIRLPOOL 972b899b0e51ba2fb5360308a35d738de199dbf48d16bb92a00f6d358d135563f3a7f7fca937691d2c258b73e1ffeee11d5230ce74cc479535a6b824add3abc4 +AUX vixie-cron-4.1-basename.diff 479 SHA256 a6ef26a9666fcbbed530195aa2f2f040778f8f5155e344e6f4979e5c152a6371 SHA512 979942efca89b724ca4bdc865d6d5ee3a298c9a1d2af69edbc3d65b3831ff99225eb7b2b4974722d38272b8fb4651806d51f2d1bf2e15e2a65deb1c64f7a8349 WHIRLPOOL 07b80da050eca4ac8e13b60996656c0bd6e8bd823cdc608b5d8d86ae60dfaa95b8200d210f14d7caa0566b15e857e1b5fcbcc1542b278783d6a3b46a44aa35ff +AUX vixie-cron-4.1-commandline.patch 387 SHA256 158eaa10c4e197c7c82b19297da298b3a56bb4bda91b5e94cd06dafaa489d4d4 SHA512 cfd85bb7999160559d462c246e6b87b0dd472dd859065adc0b3c98332b6da484a2be70a8ad55001f0d701e91f6f7f35972c1c0135cf79f1f7399a5371558c05b WHIRLPOOL 62734843003856a3e5162a4ab46e3cd5ac6d7b28e7389586f2e7714ff317e7be2dd2917c59d2328ae5b562141443c3bb26323cc2ee95ddd6d5ac1e4231b06c66 +AUX vixie-cron-4.1-cron.deny 148 SHA256 2da98580288864e2470b01bb781bb88111b719dfe6bcb10c8fd5e019e3f3a953 SHA512 e2e3a72a527d7d905b8e36f3a988eb71baebab5eb83d4a744d7c4ff4e9d6030d17bd9d8dbea30397027f4f0bbcd8df82ca0c2dd89777aade530af832fa26b5c6 WHIRLPOOL d562e8c6058ee7f69bdbb4828653112643ba2c60712e360aff58d6f5edb6aa36ea9a53780cc7f957fdc261795aec814334dbc817997c3a751d752360a18aa3c1 +AUX vixie-cron-4.1-crontabrace.patch 658 SHA256 428649286f6f3245a8fcc6a7bc39991dbdc5d2fbc8cda850c34c62c419dfea13 SHA512 7aac74563a26bc86bb99488ab0a556a389b5a3d36bed7c80c355a3504d9175d1ac8d437ebdba60831de42a1cc7188b464956f8e94876f8eaf465c9f7005b8242 WHIRLPOOL 5317ec4caea35f9e36badb186f618d96fd828372b37c29181f594fe705cd8943ff33fd325d7bd9ab65215162213bbeb431b60244b269248b5aee346eac41dfde +AUX vixie-cron-4.1-hardlink.patch 369 SHA256 abce88d7f48f902baddf532a8c137b6d55a1157d04b179b3f18b19de70b030bd SHA512 32a804929f1a005edbe58c17e5a4e57141e1b379724e1d760729ba2e5f578b9e509e5e04893e648f463dc250804a9b6303b3dfb7d91c485e57ac02e1c866600a WHIRLPOOL edb0030a0e57becfe440abc75de16b1393a40283507e512c923e4892ef4b60c7fdb8f088ceff3182b9b1ebbdd8c6e7a4ff65969530892154ea83a7cb86b79c7d +AUX vixie-cron-4.1-pam.patch 1714 SHA256 7dbfc2aaa50ab7aff012e97306fa12a1751e96c42e3af0ae82b9659ab24e660e SHA512 596e3888c9ba484b5e4f2b0db14aac0449760d9e4ca91105cac19555c4e45ae96c9e5e302335c5559697881286eae98d7149742e4f01102cc5042edf795d46fc WHIRLPOOL fef465a81aea7748645cc76aeece6aaeb1ea7d4e4deea99a3015266b4ef453584b48ed838ab9d926af8b11068cf2b4ffe123a84e83282311b46465ba45275cda +AUX vixie-cron-4.1-selinux-1.diff 4658 SHA256 35909d7c59e60ee77833a17fdf58bd03590e710e67905ebb3331bc7eff92d091 SHA512 aa226982ace71b951d46af7777c173c8c4a1dcb4fc5967fa7396cbe617a7c341add25cfbf6210aa99ab8f1af9773d55fc57985f396a827b75acca12dd542dc54 WHIRLPOOL 2bf4608cd45bb17b6cab5f1b3785928d86909bd9b9db33d822532d2153cdecccc36e6536067a516838e3414da5b5fe22557d28a64bb867e64e13e558433eb520 +AUX vixie-cron-4.1-selinux-2.patch 6566 SHA256 57aa9e3c45c3d738038bce3cbc59a2a2c2e6a44e2cfd03a8639a2257ae8a31e8 SHA512 b272b8a9dda7b80f6213ce7b0b38dc3beb16bf38ae202410c9062ae0c14653174dc309fe6dffa469058acf58fae903e0eb670b721213bbdcba3bf21eccfbdfd3 WHIRLPOOL 79bbc51793eadbab1cf4b437e84766a3edf4625e71e77ada55c2431ef2df107cc4fb1979f16f646bea62839e1780a762ffc3fc895a8f068d403dfa0f1d9aacac +AUX vixie-cron-4.1-selinux.diff 3557 SHA256 2e5df441230bed3f7fef9c63bb730d43a6293f756b64ffae29f8b98daff64524 SHA512 d8efaced8447e717ba68ab3c1b2e3097036647c46c328862bdc6060f7948c3d54ea6717dd7d684de517e516091ea28e35ca3b651e504f9b0481de21a812b2eb6 WHIRLPOOL 6b5593f074fad21a5b70461c6f2ff9787b9c8f551509c97586bb77e77e17d8b2a01f9f4c50ddfc383076ae5fc00e684a4b6a20d123fcef8b0ee0c47ef403a1ff +AUX vixie-cron-4.1-setuid_check.patch 767 SHA256 63722e28b0477f5c3195d919b6a46647b76be50c0192879e64fcd17e54882ed5 SHA512 4c49ac5465a142a49799ce1ab816aacd458b44287a3200d9dc35afe1b717d095b2db93eee70913c3c6ee4171afe1293d6838af3f0e6156a96e1e6431ded2af70 WHIRLPOOL 75d04b2a5888500393976495a283112ac3439276e7f9622576eddf6d26917015c84136311cba6bd7f9600ea03ffe2ee74d0a192c0f0b451afddb027a13617924 +AUX vixie-cron.rc7 239 SHA256 3cdbe2c12e9d694103537795c66912721f1ab9cf2bbbd3552d36437f6f965c5d SHA512 d491ae5db8e6ad00bf59380a3358577dfe45a0d137fa5100c22252b8d6d84149d379aae860a30b39c4bdbfc0274ed6cf8fe8d2dfedbea29f4260d5aaab975766 WHIRLPOOL ce0dd40f8e579829be9d540eb848dc72cf23c172fb181fb75213d4e474b246e22d69b635a72c0715fc88ff89e0a3666222673d5dced0d3763949bbf4a7dd595d +AUX vixie-cron.service 178 SHA256 248368dc7dcdd94ff641ad017cc64ed7a82a3791f81dcedea48bcc4d3e1a2a21 SHA512 09af14c9010c55c204db8755872df531d0e28b473d56f0b5f99c037e2183e2f9e2be9cc66895f4da2036b74efa7bc472e932331fac13722a505ae2be400a068d WHIRLPOOL d2fc8b7cb9c1e39f1095534f25d3c647c27c96fdfd0ed218f4b3a6544aa0c3e273c40ee50cb5a82dab29c0322cce52d04653bb252065101c912da0a7a6163aa6 +DIST vixie-cron-4.1-gentoo-r4.patch.bz2 4204 SHA256 8de14b11da567f7859df3dcf71802f32ac1b3650ae07c6cb6dbc259e1f6da7fc SHA512 eec8f89a97927a3557bd1350ed7e9baa0ec133e2c49f8f0fbf51adf62c377451dc48867ca6affcc7576833a5b6b749613c9b99641b1b658853f91d8071c3411b WHIRLPOOL 9951885d10f0f49cb0b66b1b592a870f24c04647688422c7fb396e266af0aeed7ae357bb571f13ee30aeec747ecfe78abb0335f80ea5bfd0084aee4321a581d4 +DIST vixie-cron-4.1.tar.bz2 54246 SHA256 fd25119b301e0e8306ec27ee912298740c5c8ae879bac02381429cf355d1122d SHA512 1db9a246243dbd4934438ce70bf022215ccffed4b899a77b076d5a7679a7b98a23ef67344e329fc7a836df90685581e10b1c95709db40601c33d2052ce561e04 WHIRLPOOL e137a0e056103efc1bf0aa022bf0f9e2ca3ab8bb3ff97645de27c2e381a4aa5303d477cd1bc6220177aa503c2bce5bbe2331d311dfac4f5ab43cf6928dbe1ea7 +EBUILD vixie-cron-4.1-r14.ebuild 3493 SHA256 54bdc9689ae51ea6a8d961c5a862b2b179d05219cd79b7b993d1600e15124086 SHA512 b51b9b7b81394c285db9b1a44aa4cc0b194c0b9480fbc1a57cf644db6b689b5715a763585c6145b8551a44e1676aabe409bc08c96a16de663c57d14184079c2c WHIRLPOOL f73639db790901d1e448062c1a36e5eccc1a4c1b7f7cc073032146f3477322470b5c568648597e256fbb39270cdae04fa285037f10f356ff6807df8dd9413839 +EBUILD vixie-cron-4.1-r15.ebuild 3507 SHA256 36357a62d775523a35e725b9f1a3fcec242d0d5c188b88cf8ca3cd6c6a171b2a SHA512 fef94027206efd56bbc2452392d9ed77332a942ac9eb6df3d358d71e8622bb23a3304215e2131c0a971e12e856db7dc2e7768fda2b438f1a77cfc9d736b6044c WHIRLPOOL 440b3386725ce795647f4c3170f02b32bead777f60e09a4cc2f50e4c6303469ffff182becf33a7117f655d1e0b6f2329be81c09562b48eeb9130a874e8c0c5a5 +MISC ChangeLog 3256 SHA256 8331d01c2abdf9d5ea9abc969c3d172a07e38e8395a3b9ab4a8dafc80d41fc55 SHA512 d6c5ac7898ad8be3e4171e90d0957fea01b48f6d0dea011b8a8cc6e2120907721f5e4ec4461a7741ee9909efb9fb1a73218ba45479977f3c276e9b53db9f7f15 WHIRLPOOL 1c8740f364acb4e34e1d40b0a0040634f2766e84c72264ffada2e828f1be4535461f0bdde2a785ebbd427eddbecbe2aa8e01fe09d9d74ce9beb153af43d2b639 +MISC ChangeLog-2015 24228 SHA256 9ab7b065b5fc93ce8b3602cf1105dee690b53a2e3ab58ccf4fafc9b7bf7b1e42 SHA512 faf5e627979e5b3500ca99af9eaf4d0b3b362ffed25be809f8e129f841227bbdd881750b3f18d7cd2c997c58e98b7e7890e69f2696b51b748bac82a245de1379 WHIRLPOOL d120d61750414f765097afdf93e1977846d41607aba77047ae8140a4c318ce1ccedfbbabcd850369f1284ed5e37ef6946252ff150d21cadc5a91e6b0f41684cc +MISC metadata.xml 256 SHA256 cbca1ae57df68811dc0f0eeceb7449e69bc046966ad0feff3279e148f7db2f18 SHA512 155f3cbb14ae54e9dfb98e954f6bdf7f23bf5654ae2d00549f7722085a7243d934dfd99d6f1325b00dcaeb50c5344e818e602dc4e2fe47dc7aeb1fdb77668521 WHIRLPOOL 37d54b13f923df58d35217014422b6b484597ce1f80f39a4c6d8a4906d3c5dff6d8c4e14972abb5bdc3a041006c5b691d1d284dbcab35bdffd0e6a013c110215 diff --git a/sys-process/vixie-cron/files/crontab b/sys-process/vixie-cron/files/crontab new file mode 100644 index 000000000000..15622cb83e60 --- /dev/null +++ b/sys-process/vixie-cron/files/crontab @@ -0,0 +1,15 @@ +# for vixie cron +# + +# Global variables +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ + +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly +*/15 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons +0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly +0 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily +15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly +30 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly diff --git a/sys-process/vixie-cron/files/crontab-3.0.1-r4 b/sys-process/vixie-cron/files/crontab-3.0.1-r4 new file mode 100644 index 000000000000..d1720d49496a --- /dev/null +++ b/sys-process/vixie-cron/files/crontab-3.0.1-r4 @@ -0,0 +1,14 @@ +# for vixie cron + +# Global variables +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ + +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly +59 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly +9 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily +19 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly +29 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly +*/10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons diff --git a/sys-process/vixie-cron/files/crontab.5.diff b/sys-process/vixie-cron/files/crontab.5.diff new file mode 100644 index 000000000000..f50db3dc7902 --- /dev/null +++ b/sys-process/vixie-cron/files/crontab.5.diff @@ -0,0 +1,35 @@ +--- crontab.5.orig 2004-02-19 20:40:04.954132624 +0000 ++++ crontab.5 2004-02-19 20:45:27.033169168 +0000 +@@ -153,6 +153,32 @@ + ``30 4 1,15 * 5'' + would cause a command to be run at 4:30 am on the 1st and 15th of each + month, plus every Friday. ++.PP ++Instead of the first five fields, one of eight special strings may ++appear: ++.IP ++.ta 1.5i ++string meaning ++.br ++------ ------- ++.br ++@reboot Run once, at startup. ++.br ++@yearly Run once a year, "0 0 1 1 *". ++.br ++@annually (same as @yearly) ++.br ++@monthly Run once a month, "0 0 1 * *". ++.br ++@weekly Run once a week, "0 0 * * 0". ++.br ++@daily Run once a day, "0 0 * * *". ++.br ++@midnight (same as @daily) ++.br ++@hourly Run once an hour, "0 * * * *". ++.br ++.fi + .SH EXAMPLE CRON FILE + .nf + diff --git a/sys-process/vixie-cron/files/pamd.compatible b/sys-process/vixie-cron/files/pamd.compatible new file mode 100644 index 000000000000..62eb029eac54 --- /dev/null +++ b/sys-process/vixie-cron/files/pamd.compatible @@ -0,0 +1,7 @@ +#%PAM-1.0 + +account required pam_unix.so + +auth required pam_unix.so + +session optional pam_limits.so diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-basename.diff b/sys-process/vixie-cron/files/vixie-cron-4.1-basename.diff new file mode 100644 index 000000000000..c7930ddc4e97 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-basename.diff @@ -0,0 +1,20 @@ +diff --exclude='*~' -urN vixie-cron-4.1.orig/cron.c vixie-cron-4.1/cron.c +--- vixie-cron-4.1.orig/cron.c 2005-02-23 02:05:30.730975808 -0500 ++++ vixie-cron-4.1/cron.c 2005-02-23 02:07:13.233393072 -0500 +@@ -25,6 +25,7 @@ + + #define MAIN_PROGRAM + ++#include <libgen.h> + #include "cron.h" + + enum timejump { negative, small, medium, large }; +@@ -61,7 +62,7 @@ + cron_db database; + int fd; + +- ProgramName = argv[0]; ++ ProgramName = basename(argv[0]); + + setlocale(LC_ALL, ""); + diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-commandline.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-commandline.patch new file mode 100644 index 000000000000..d204ad882aa2 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-commandline.patch @@ -0,0 +1,13 @@ +--- entry.c.orig 2004-08-27 20:09:34.000000000 +0200 ++++ entry.c 2004-12-01 22:16:10.992268200 +0100 +@@ -336,7 +336,9 @@ + + /* If the first character of the command is '-' it is a cron option. + */ +- while ((ch = get_char(file)) == '-') { ++ ch = get_char(file); ++ Skip_Blanks(ch, file) ++ while (ch == '-') { + switch (ch = get_char(file)) { + case 'q': + e->flags |= DONT_LOG; diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-cron.deny b/sys-process/vixie-cron/files/vixie-cron-4.1-cron.deny new file mode 100644 index 000000000000..f703d5846e41 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-cron.deny @@ -0,0 +1,4 @@ +# If for any reason you have users in the 'cron' group who should not +# be allowed to run crontab, add them to this file (one username per +# line) + diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-crontabrace.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-crontabrace.patch new file mode 100644 index 000000000000..5109554e1dd1 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-crontabrace.patch @@ -0,0 +1,29 @@ +--- vixie-cron-4.1/crontab.c ++++ vixie-cron-4.1/crontab.c +@@ -314,8 +314,6 @@ + perror("fstat"); + goto fatal; + } +- utimebuf.actime = statbuf.st_atime; +- utimebuf.modtime = statbuf.st_mtime; + + /* Turn off signals. */ + (void)signal(SIGHUP, SIG_IGN); +@@ -374,6 +372,17 @@ + perror(Filename); + exit(ERROR_EXIT); + } ++ if (swap_uids() < OK) { ++ perror("swapping uids"); ++ exit(ERROR_EXIT); ++ } ++ utimebuf.actime = statbuf.st_atime; ++ utimebuf.modtime = statbuf.st_mtime; ++ utime(Filename, &utimebuf); ++ if (swap_uids_back() < OK) { ++ perror("swapping uids back"); ++ exit(ERROR_EXIT); ++ } + utime(Filename, &utimebuf); + again: + rewind(NewCrontab); diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-hardlink.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-hardlink.patch new file mode 100644 index 000000000000..cabdef02e67b --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-hardlink.patch @@ -0,0 +1,11 @@ +--- database.c.orig 2007-04-08 21:06:16.913019387 +0200 ++++ database.c 2007-04-08 21:06:29.489736093 +0200 +@@ -251,7 +251,7 @@ + log_it(fname, getpid(), "WRONG FILE OWNER", tabname); + goto next_crontab; + } +- if (statbuf->st_nlink != 1) { ++ if (statbuf->st_nlink != 1 && pw != NULL) { + log_it(fname, getpid(), "BAD LINK COUNT", tabname); + goto next_crontab; + } diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-pam.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-pam.patch new file mode 100644 index 000000000000..64bf67138e70 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-pam.patch @@ -0,0 +1,67 @@ +--- vixie-cron-3.0.1.orig/Makefile Thu May 30 19:47:00 2002 ++++ vixie-cron-3.0.1/Makefile Thu May 30 20:54:46 2002 +@@ -55,7 +55,7 @@ + INCLUDE = -I. + #INCLUDE = + #<<need getopt()>> +-LIBS = ++LIBS = -lpam + #<<optimize or debug?>> + OPTIM = $(RPM_OPT_FLAGS) + #OPTIM = -g +--- vixie-cron-3.0.1.orig/do_command.c Thu May 30 19:47:00 2002 ++++ vixie-cron-3.0.1/do_command.c Thu May 30 20:55:50 2002 +@@ -25,6 +25,18 @@ + + #include "cron.h" + ++#include <security/pam_appl.h> ++static pam_handle_t *pamh = NULL; ++static const struct pam_conv conv = { ++ NULL ++}; ++#define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \ ++ fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \ ++ syslog(LOG_ERR,"%s",pam_strerror(pamh, retcode)); \ ++ pam_end(pamh, retcode); exit(1); \ ++ } ++ ++ + static void child_process(entry *, user *); + static int safe_p(const char *, const char *); + +@@ -65,6 +77,7 @@ + int stdin_pipe[2], stdout_pipe[2]; + char *input_data, *usernm, *mailto; + int children = 0; ++ int retcode = 0; + + Debug(DPROC, ("[%ld] child_process('%s')\n", (long)getpid(), e->cmd)) + +@@ -134,6 +147,16 @@ + *p = '\0'; + } + ++ ++ retcode = pam_start("cron", usernm, &conv, &pamh); ++ PAM_FAIL_CHECK; ++ retcode = pam_acct_mgmt(pamh, PAM_SILENT); ++ PAM_FAIL_CHECK; ++ retcode = pam_open_session(pamh, PAM_SILENT); ++ PAM_FAIL_CHECK; ++ retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED | PAM_SILENT); ++ PAM_FAIL_CHECK; ++ + /* fork again, this time so we can exec the user's command. + */ + switch (vfork()) { +@@ -507,6 +530,9 @@ + Debug(DPROC, (", dumped core")) + Debug(DPROC, ("\n")) + } ++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT); ++ retcode = pam_close_session(pamh, PAM_SILENT); ++ pam_end(pamh, retcode); + } + + static int 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..ec2493e8c3ca --- /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$ + + #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$ + + #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/files/vixie-cron-4.1-selinux-2.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux-2.patch new file mode 100644 index 000000000000..2341d092387d --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux-2.patch @@ -0,0 +1,225 @@ +diff -ur vixie-cron-4.1/Makefile vixie-cron-4.1-selinux/Makefile +--- vixie-cron-4.1/Makefile 2004-08-28 02:09:33.000000000 +0800 ++++ vixie-cron-4.1-selinux/Makefile 2017-04-26 22:16:53.321394815 +0800 +@@ -68,7 +68,8 @@ + #<<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 -ur vixie-cron-4.1/database.c vixie-cron-4.1-selinux/database.c +--- vixie-cron-4.1/database.c 2004-08-28 02:09:34.000000000 +0800 ++++ vixie-cron-4.1-selinux/database.c 2017-04-27 01:31:34.757942605 +0800 +@@ -28,6 +28,15 @@ + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#include <selinux/context.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 +192,7 @@ + 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 +254,117 @@ + 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; ++ context_t current_context = NULL; ++ char *current_context_str = NULL; ++ struct av_decision avd; ++ int retval=0; ++ char *seuser=NULL; ++ char *level=NULL; ++ int sys_user = 0; ++ ++ sys_user = strcmp(SYSUSERNAME, fname); ++ ++ if (fgetfilecon(crontab_fd, &file_context) < OK) { ++ log_it(fname, getpid(), "getfilecon FAILED", tabname); ++ goto next_crontab; ++ } ++ ++ if (sys_user != 0) { ++ if (getseuserbyname(fname, &seuser, &level) < 0) { ++ log_it(fname, getpid(), "NO SEUSER", tabname); ++ goto next_crontab; ++ } ++ } else { ++ if (getcon(¤t_context_str) < 0) { ++ log_it(fname, getpid(), "getcon FAILED", tabname); ++ goto next_crontab; ++ } ++ ++ current_context = context_new(current_context_str); ++ if (current_context == 0) { ++ log_it(fname, getpid(), "context new FAILED", tabname); ++ freecon(current_context_str); ++ goto next_crontab; ++ } ++ ++ seuser = context_user_get(current_context); ++ level = context_range_get(current_context); ++ } ++ ++ if (get_default_context_with_level(seuser, level, NULL, &user_context) < 0) { ++ log_it(fname, getpid(), "NO CONTEXT", tabname); ++ freecon(file_context); ++ if (sys_user != 0) { ++ free(seuser); ++ free(level); ++ } ++ freecon(current_context_str); ++ context_free(current_context); ++ 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. ++ */ ++ security_class_t file_class; ++ access_vector_t entrypoint_bit; ++ file_class = string_to_security_class("file"); ++ if (file_class == 0) { ++ log_it(fname, getpid(), "file CLASS NOT DEFINED", tabname); ++ freecon(current_context_str); ++ context_free(current_context); ++ freecon(user_context); ++ freecon(file_context); ++ if (sys_user != 0) { ++ free(seuser); ++ free(level); ++ } ++ goto next_crontab; ++ } ++ ++ entrypoint_bit = string_to_av_perm(file_class, "entrypoint"); ++ if (entrypoint_bit == 0) { ++ log_it(fname, getpid(), "file:entrypoint AV NOT DEFINED", tabname); ++ freecon(current_context_str); ++ context_free(current_context); ++ freecon(user_context); ++ freecon(file_context); ++ if (sys_user != 0) { ++ free(seuser); ++ free(level); ++ } ++ goto next_crontab; ++ } ++ ++ retval = security_compute_av_raw(user_context, ++ file_context, ++ file_class, ++ entrypoint_bit, ++ &avd); ++ ++ freecon(user_context); ++ freecon(file_context); ++ if (sys_user != 0) { ++ free(seuser); ++ free(level); ++ } ++ context_free(current_context); ++ freecon(current_context_str); ++ ++ if (retval || ((entrypoint_bit & avd.allowed) != entrypoint_bit)) { ++ 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 -ur vixie-cron-4.1/do_command.c vixie-cron-4.1-selinux/do_command.c +--- vixie-cron-4.1/do_command.c 2004-08-28 02:09:34.000000000 +0800 ++++ vixie-cron-4.1-selinux/do_command.c 2017-04-27 01:30:49.045144698 +0800 +@@ -25,6 +25,12 @@ + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#include <selinux/context.h> ++#include <selinux/get_context_list.h> ++#endif ++ + static void child_process(entry *, user *); + static int safe_p(const char *, const char *); + +@@ -265,6 +271,49 @@ + _exit(OK_EXIT); + } + # endif /*DEBUGGING*/ ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled()) { ++ char *seuser = NULL; ++ char *level = NULL; ++ char *current_context_str = NULL; ++ security_context_t scontext; ++ context_t current_context = NULL; ++ ++ if (strcmp("system_u", u->name) != 0) { ++ if (getseuserbyname(u->name, &seuser, &level) < 0) { ++ fprintf(stderr, "getseuserbyname: Could not determine seuser for user %s\n", u->name); ++ _exit(ERROR_EXIT); ++ } ++ } else { ++ if (getcon(¤t_context_str) < 0) { ++ fprintf(stderr, "getcon FAILED\n"); ++ _exit(ERROR_EXIT); ++ } ++ ++ current_context = context_new(current_context_str); ++ if (current_context == NULL) { ++ fprintf(stderr, "failed to create new context: %s\n", current_context_str); ++ freecon(current_context_str); ++ _exit(ERROR_EXIT); ++ } ++ ++ seuser = context_user_get(current_context); ++ } ++ ++ 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/files/vixie-cron-4.1-selinux.diff b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux.diff new file mode 100644 index 000000000000..a4621e2530da --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux.diff @@ -0,0 +1,117 @@ +--- vixie-cron-3.0.1/Makefile.selinux 2003-05-20 14:52:06.000000000 -0400 ++++ vixie-cron-3.0.1/Makefile 2003-05-20 14:52:21.000000000 -0400 +@@ -71,7 +71,8 @@ LINTFLAGS = -hbxa $(INCLUDE) $(COMPAT) $ + #<<want to use a nonstandard CC?>> + #CC = vcc + #<<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>> +--- vixie-cron-3.0.1/database.c.selinux 2003-05-20 14:52:56.000000000 -0400 ++++ vixie-cron-3.0.1/database.c 2003-05-23 13:27:24.898020960 -0400 +@@ -28,6 +28,15 @@ + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#include <selinux/flask.h> ++#include <selinux/av_permissions.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 *, +@@ -217,7 +226,7 @@ + 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. + */ +@@ -279,6 +288,43 @@ + 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; ++ ++ 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 (get_default_context(fname, NULL, &user_context)) { ++ log_it(fname, getpid(), "NO CONTEXT", tabname); ++ freecon(file_context); ++ goto next_crontab; ++ } ++ retval = security_compute_av(user_context, ++ file_context, ++ SECCLASS_FILE, ++ FILE__ENTRYPOINT, ++ &avd); ++ freecon(user_context); ++ freecon(file_context); ++ 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; +--- vixie-cron-3.0.1/do_command.c.selinux 2003-05-20 14:53:12.000000000 -0400 ++++ vixie-cron-3.0.1/do_command.c 2003-05-20 14:58:06.000000000 -0400 +@@ -25,6 +25,10 @@ + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#endif ++ + static void child_process(entry *, user *); + static int safe_p(const char *, const char *); + +@@ -265,6 +269,20 @@ + _exit(OK_EXIT); + } + # endif /*DEBUGGING*/ ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled()) { ++ security_context_t scontext; ++ if (get_default_context(u->name, NULL, &scontext)) { ++ fprintf(stderr, "execle_secure: couldn't get security context for user %s\n", u->name); ++ _exit(ERROR_EXIT); ++ } ++ if (setexeccon(scontext) < 0) { ++ fprintf(stderr, "Could not set exec context to %s for user %s\n", scontext,u->name); ++ _exit(ERROR_EXIT); ++ } ++ 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/files/vixie-cron-4.1-setuid_check.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-setuid_check.patch new file mode 100644 index 000000000000..42fd8e13edd9 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-setuid_check.patch @@ -0,0 +1,29 @@ +--- vixie-cron-4.1/do_command.c 2006-05-25 16:44:26.000000000 +0400 ++++ vixie-cron-4.1.lk/do_command.c 2006-05-25 16:42:25.000000000 +0400 +@@ -240,12 +240,23 @@ + } + } + #else +- setgid(e->pwd->pw_gid); ++ + initgroups(usernm, e->pwd->pw_gid); + #if (defined(BSD)) && (BSD >= 199103) + setlogin(usernm); + #endif /* BSD */ +- setuid(e->pwd->pw_uid); /* we aren't root after this... */ ++ // setuid(e->pwd->pw_uid); /* we aren't root after this... */ ++ ++ if ( setgid(e->pwd->pw_gid) == -1 ) { ++ fprintf(stderr,"can't set gid for %s\n", e->pwd->pw_name); ++ _exit(1); ++ } ++ ++ if ( setuid(e->pwd->pw_uid) == -1 ) { ++ fprintf(stderr,"can't set uid for %s\n", e->pwd->pw_name); ++ _exit(1); ++ } ++ + + #endif /* LOGIN_CAP */ + chdir(env_get("HOME", e->envp)); + diff --git a/sys-process/vixie-cron/files/vixie-cron.rc7 b/sys-process/vixie-cron/files/vixie-cron.rc7 new file mode 100644 index 000000000000..0bb47f4af8dc --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron.rc7 @@ -0,0 +1,12 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command=/usr/sbin/cron +pidfile=/var/run/cron.pid + +depend() { + use clock logger + need localmount + provide cron +} diff --git a/sys-process/vixie-cron/files/vixie-cron.service b/sys-process/vixie-cron/files/vixie-cron.service new file mode 100644 index 000000000000..66c3862e47ed --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron.service @@ -0,0 +1,11 @@ +[Unit] +Description=Vixie Cron Daemon + +[Service] +Type=forking +ExecStart=/usr/sbin/cron +ExecStop=/bin/kill -TERM $MAINPID +IgnoreSIGPIPE=false + +[Install] +WantedBy=multi-user.target diff --git a/sys-process/vixie-cron/metadata.xml b/sys-process/vixie-cron/metadata.xml new file mode 100644 index 000000000000..a22ac52b016b --- /dev/null +++ b/sys-process/vixie-cron/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>cron-bugs@gentoo.org</email> + <name>Gentoo Cron Project</name> + </maintainer> +</pkgmetadata> diff --git a/sys-process/vixie-cron/vixie-cron-4.1-r14.ebuild b/sys-process/vixie-cron/vixie-cron-4.1-r14.ebuild new file mode 100644 index 000000000000..c0ddaff47e92 --- /dev/null +++ b/sys-process/vixie-cron/vixie-cron-4.1-r14.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit cron toolchain-funcs pam eutils flag-o-matic user systemd + +# 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="ISC BSD-2 BSD" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~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 + epatch "${FILESDIR}"/${P}-crontabrace.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.rc7 vixie-cron + + # doc stuff + doman crontab.1 crontab.5 cron.8 + dodoc "${FILESDIR}"/crontab + dodoc CHANGES CONVERSION FEATURES MAIL README THANKS + + systemd_dounit "${FILESDIR}/${PN}.service" +} + +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 +} diff --git a/sys-process/vixie-cron/vixie-cron-4.1-r15.ebuild b/sys-process/vixie-cron/vixie-cron-4.1-r15.ebuild new file mode 100644 index 000000000000..1e06308a812f --- /dev/null +++ b/sys-process/vixie-cron/vixie-cron-4.1-r15.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit cron toolchain-funcs pam eutils flag-o-matic user systemd + +# 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-2.patch" +GENTOO_PATCH_REV="r4" + +SRC_URI="mirror://gentoo/${P}.tar.bz2 + mirror://gentoo/${P}-gentoo-${GENTOO_PATCH_REV}.patch.bz2" + +LICENSE="ISC BSD-2 BSD" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~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 + epatch "${FILESDIR}"/${P}-crontabrace.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.rc7 vixie-cron + + # doc stuff + doman crontab.1 crontab.5 cron.8 + dodoc "${FILESDIR}"/crontab + dodoc CHANGES CONVERSION FEATURES MAIL README THANKS + + systemd_dounit "${FILESDIR}/${PN}.service" +} + +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 +} |