summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2012-08-30 06:42:46 +0000
committerJustin Lecher <jlec@gentoo.org>2012-08-30 06:42:46 +0000
commitcbae8503be5b906269620d88f21ef01c5974eefa (patch)
tree1027c32df707a4491ac711b28fecc58ccab60771 /sys-process
parentx86 stable, see bug 385321 (diff)
downloadgentoo-2-cbae8503be5b906269620d88f21ef01c5974eefa.tar.gz
gentoo-2-cbae8503be5b906269620d88f21ef01c5974eefa.tar.bz2
gentoo-2-cbae8503be5b906269620d88f21ef01c5974eefa.zip
sys-process/fcron: User src_prepare instead of src_unpack; indent input redirections; don't use ewarn for blank lines; use defualt src_ompile(); fix potential buffer overflow
(Portage version: 2.2.0_alpha123/cvs/Linux x86_64)
Diffstat (limited to 'sys-process')
-rw-r--r--sys-process/fcron/ChangeLog8
-rw-r--r--sys-process/fcron/fcron-3.0.6-r3.ebuild47
-rw-r--r--sys-process/fcron/files/fcron-3.0.6-buffer-overflow.patch16
-rw-r--r--sys-process/fcron/metadata.xml30
4 files changed, 60 insertions, 41 deletions
diff --git a/sys-process/fcron/ChangeLog b/sys-process/fcron/ChangeLog
index 0fa75a3f6f3b..38954e47411d 100644
--- a/sys-process/fcron/ChangeLog
+++ b/sys-process/fcron/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sys-process/fcron
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/ChangeLog,v 1.94 2012/08/29 17:48:36 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/ChangeLog,v 1.95 2012/08/30 06:42:46 jlec Exp $
+
+ 30 Aug 2012; Justin Lecher <jlec@gentoo.org> fcron-3.0.6-r3.ebuild,
+ +files/fcron-3.0.6-buffer-overflow.patch, metadata.xml:
+ User src_prepare instead of src_unpack; indent input redirections; don't use
+ ewarn for blank lines; use defualt src_ompile(); fix potential buffer
+ overflow
29 Aug 2012; Diego E. Pettenò <flameeyes@gentoo.org> fcron-3.0.6-r3.ebuild:
Fix comment in pam.d file.
diff --git a/sys-process/fcron/fcron-3.0.6-r3.ebuild b/sys-process/fcron/fcron-3.0.6-r3.ebuild
index dded08a27119..c59483953ffb 100644
--- a/sys-process/fcron/fcron-3.0.6-r3.ebuild
+++ b/sys-process/fcron/fcron-3.0.6-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/fcron-3.0.6-r3.ebuild,v 1.2 2012/08/29 17:48:36 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/fcron-3.0.6-r3.ebuild,v 1.3 2012/08/30 06:42:46 jlec Exp $
EAPI=4
@@ -35,9 +35,8 @@ pkg_setup() {
[[ ${rootgroup} ]] || rootgroup=root
}
-src_unpack() {
- unpack ${A}
- cd "${S}"
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-buffer-overflow.patch
# respect LDFLAGS
sed -i "s:\(@LIBS@\):\$(LDFLAGS) \1:" Makefile.in || die "sed failed"
@@ -76,7 +75,7 @@ src_configure() {
}
src_compile() {
- emake || die "make failed"
+ default
# bug #216460
sed -i \
@@ -135,17 +134,17 @@ src_install() {
fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
pamd_mimic system-services fcron auth account session
- cat - > "${T}"/fcrontab.pam <<EOF
-# Don't ask for the user's password; fcrontab will only allow to
-# change user if running as root.
-auth sufficient pam_permit.so
-
-# Still use the system-auth stack for account and session as the
-# sysadmin might have set up stuff properly, and also avoids
-# sidestepping limits (since fcrontab will run \$EDITOR).
-account include system-auth
-session include system-auth
-EOF
+ cat > "${T}"/fcrontab.pam <<- EOF
+ # Don't ask for the user's password; fcrontab will only allow to
+ # change user if running as root.
+ auth sufficient pam_permit.so
+
+ # Still use the system-auth stack for account and session as the
+ # sysadmin might have set up stuff properly, and also avoids
+ # sidestepping limits (since fcrontab will run \$EDITOR).
+ account include system-auth
+ session include system-auth
+ EOF
newpamd "${T}"/fcrontab.pam fcrontab
newinitd "${FILESDIR}"/fcron.init.3 fcron
@@ -170,9 +169,9 @@ pkg_postinst() {
elog " emerge --config ${CATEGORY}/${PN}"
elog "to configure the proper settings."
if ! use system-crontab; then
- ewarn ""
+ echo ""
ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
- ewarn ""
+ echo ""
fi
}
@@ -192,11 +191,11 @@ pkg_config() {
else
elog "This is going to set up fcron to set up a default systab that"
elog "executes /etc/cron.{hourly,daily,weekly,monthly}."
- fcrontab -u systab - <<EOF
-0 * * * * rm -f /var/spool/cron/lastrun/cron.hourly
-1 3 * * * rm -f /var/spool/cron/lastrun/cron.daily
-15 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly
-30 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly
-EOF
+ fcrontab -u systab - <<- EOF
+ 0 * * * * rm -f /var/spool/cron/lastrun/cron.hourly
+ 1 3 * * * rm -f /var/spool/cron/lastrun/cron.daily
+ 15 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly
+ 30 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly
+ EOF
fi
}
diff --git a/sys-process/fcron/files/fcron-3.0.6-buffer-overflow.patch b/sys-process/fcron/files/fcron-3.0.6-buffer-overflow.patch
new file mode 100644
index 000000000000..75fb0c3337f4
--- /dev/null
+++ b/sys-process/fcron/files/fcron-3.0.6-buffer-overflow.patch
@@ -0,0 +1,16 @@
+ socket.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/socket.c b/socket.c
+index ef04ebe..2f7f4ac 100644
+--- a/socket.c
++++ b/socket.c
+@@ -272,7 +272,7 @@ auth_client(struct fcrondyn_cl *client)
+ len += (sizeof(FIELD_STR)-1); \
+ }
+ #define Add_field(FIELD_STR) \
+- strncat(fields, FIELD_STR, sizeof(fields) - len); \
++ strncat(fields, FIELD_STR, sizeof(fields)-1 - len); \
+ len += (sizeof(FIELD_STR)-1);
+
+ void
diff --git a/sys-process/fcron/metadata.xml b/sys-process/fcron/metadata.xml
index 54be2f8daf41..18d7ea120602 100644
--- a/sys-process/fcron/metadata.xml
+++ b/sys-process/fcron/metadata.xml
@@ -1,34 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <herd>cron</herd>
- <maintainer>
- <email>wschlich@gentoo.org</email>
- <name>Wolfram Schlich</name>
- <description>Primary maintainer</description>
- </maintainer>
- <maintainer>
- <email>flameeyes@gentoo.org</email>
- </maintainer>
- <use>
- <flag name="debug">
+ <herd>cron</herd>
+ <maintainer>
+ <email>wschlich@gentoo.org</email>
+ <name>Wolfram Schlich</name>
+ <description>Primary maintainer</description>
+ </maintainer>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="debug">
Enable debug code and output. Since version 3.0.5 this will no
longer force foreground execution, and fcron will be able to run
as a service properly.
</flag>
-
- <flag name="pam">
+ <flag name="pam">
Enable PAM support for fcron. This means that fcron will pass
through the "fcron" stack before executing the jobs, and
fcrontab will use the "fcrontab" stack to authenticate the user
before editing its crontab file.
</flag>
-
- <flag name="system-crontab">
+ <flag name="system-crontab">
Set up fcron to respect /etc/crontab and /etc/cron.d. If this
flag is disabled, /etc/cron.d and /etc/crontab will be ignored,
but /etc/cron.{hourly,daily,weekly,monthly} will still be
respected.
</flag>
- </use>
+ </use>
</pkgmetadata>