Drop unused ebuilds for games-rpg/dear-esther, games-puzzle/braid and net-analyzer/arpwatch
This commit is contained in:
parent
f1f9007112
commit
c1bff5a80f
@ -1,2 +0,0 @@
|
|||||||
DIST braid-linux-build2.run.bin 125096547 SHA256 faa86ac125f541e9e684e7c09f9c23705fb6db8813437a11007aaca1ea040a3b SHA512 969b122bf5903fbe618cba08de1532b39eb52c674ac97a4395036dff74ecd1838a2b207a7800577902730e5cb4c2fbd0e3bbd8bbecfead121c039b5db4ac69dc WHIRLPOOL cb3ebb351d9c640fb4954ef0604a43ac3b39359a57511fad18e26d4a6bed00605b184a247d194acdb826405f20dee63a8e861fd24d0a6f843342c774a6efc233
|
|
||||||
DIST braid-rus.tar.bz2 917064 SHA256 5cf4291a9e1e18c5b3aec325319a4f9b97f5aa880e484aa850bae99b99bd439f SHA512 1ead8721c0ae035034a4d2163822ea57fc44f77441c8da2f2bb8b23b88d5c94287d9e405f85426f1add6ef2f93c5a8bc588bc5a5db97626f78097efd5aac3c40 WHIRLPOOL 286c8aad7879572c3000327987a26338edc9e338609792d281da5248884eedca2da43896dcb6368a34a48d5b8c70aae1fb0f0653f2f3de454f0c0afa3334bb52
|
|
@ -1,72 +0,0 @@
|
|||||||
# Copyright 1999-2012 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: $
|
|
||||||
|
|
||||||
EAPI=4
|
|
||||||
|
|
||||||
inherit games versionator
|
|
||||||
|
|
||||||
MY_PV="$(get_version_component_range 3)"
|
|
||||||
|
|
||||||
DESCRIPTION="Platform game where you manipulate flow of time"
|
|
||||||
HOMEPAGE="http://braid-game.com"
|
|
||||||
SRC_URI="${PN}-linux-build${MY_PV}.run.bin
|
|
||||||
linguas_ru? ( ${PN}-rus.tar.bz2 )"
|
|
||||||
|
|
||||||
LICENSE="Arphic MIT"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~amd64 ~x86"
|
|
||||||
|
|
||||||
IUSE="linguas_ru"
|
|
||||||
RESTRICT="fetch mirror strip"
|
|
||||||
|
|
||||||
DEPEND="app-arch/unzip"
|
|
||||||
RDEPEND="media-libs/libsdl[joystick,sound,video]
|
|
||||||
x11-libs/libX11
|
|
||||||
x11-libs/libXau
|
|
||||||
x11-libs/libxcb
|
|
||||||
x11-libs/libXdmcp
|
|
||||||
x11-libs/libXext
|
|
||||||
virtual/opengl
|
|
||||||
media-gfx/nvidia-cg-toolkit"
|
|
||||||
|
|
||||||
S="${WORKDIR}/data"
|
|
||||||
|
|
||||||
pkg_nofetch() {
|
|
||||||
elog
|
|
||||||
elog "Download ${SRC_URI} from ${HOMEPAGE} and place it in ${DISTDIR}"
|
|
||||||
elog
|
|
||||||
}
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
# self unpacking zip archive; unzip warns about the exe stuff
|
|
||||||
local a="${DISTDIR}/${PN}-linux-build${MY_PV}.run.bin"
|
|
||||||
echo ">>> Unpacking ${a} to ${PWD}"
|
|
||||||
unzip -q "${a}"
|
|
||||||
[ $? -gt 1 ] && die "unpacking failed"
|
|
||||||
|
|
||||||
if use linguas_ru; then
|
|
||||||
unpack "${PN}-rus.tar.bz2"
|
|
||||||
mv "${S}/package0.zip" "${S}/gamedata/data" || die
|
|
||||||
mv "${S}/strings/english.mo" "${S}/gamedata/data/strings" || die
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
local dir="${GAMES_PREFIX_OPT}/${PN}"
|
|
||||||
|
|
||||||
insinto "${dir}"
|
|
||||||
exeinto "${dir}"
|
|
||||||
|
|
||||||
doins -r gamedata/data
|
|
||||||
use x86 && doexe x86/"${PN}"
|
|
||||||
use amd64 && doexe amd64/"${PN}"
|
|
||||||
|
|
||||||
doicon gamedata/"${PN}.png"
|
|
||||||
dodoc gamedata/README-linux.txt
|
|
||||||
|
|
||||||
games_make_wrapper "${PN}" "./${PN}" "${dir}"
|
|
||||||
make_desktop_entry "${PN}" "Braid" "${PN}"
|
|
||||||
|
|
||||||
prepgamesdirs
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<maintainer>
|
|
||||||
<email>pinkbyte@gentoo.org</email>
|
|
||||||
<name>Sergey Popov</name>
|
|
||||||
</maintainer>
|
|
||||||
</pkgmetadata>
|
|
@ -1,2 +0,0 @@
|
|||||||
DIST DE_Russian.rar 131005 SHA256 c74f1de7276833c3d9281e2d570bd7ced14c859ca8b95a7a16381d8cb6f0ae47 SHA512 e74b7cd925001acc342510c21fb78692df266e47fd21664a83174f981b9670e467868d3c6a157e831b1cd776a8444ed70cc0973aa222a4ee80f94545191392cc WHIRLPOOL 49daf1eb5e2f202f92d927fe649fd0f20bc57e39e50335181b8a5b4218771c2b29f248e446d7179265f92a74d8b8b4c383d95eff610dd27268069e0ee97a1eb0
|
|
||||||
DIST dearesther-linux-06082013-bin 1007461686 SHA256 4b3368e9cd83f371b6ea63814ce1ec5db733d5ef3229e3f78bdc530c268076a4 SHA512 c66a2b068b4caaebfb63e4617102af4a5df153dfe76854d1fa94305fb95b15e4362c9ca5e715ea4b29966916a9a585fa71bfc2b2b33b878f26e3785b7d93722e WHIRLPOOL 022d2fe66dfb2f4bea71898afd6f011ffe5870c5af27e3adb04fe5caa76a41bce75ee931408edda41dc24956ddae4f2399719f3938d72fe9cf94b2a9e2e703ea
|
|
@ -1,100 +0,0 @@
|
|||||||
# Copyright 1999-2015 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Id$
|
|
||||||
|
|
||||||
# TODO: unbundle libSDL2
|
|
||||||
|
|
||||||
EAPI=5
|
|
||||||
|
|
||||||
inherit eutils gnome2-utils unpacker games
|
|
||||||
|
|
||||||
TIMESTAMP="${PV:4:2}${PV:6:2}${PV:0:4}"
|
|
||||||
DESCRIPTION="Ghost story, told using first-person gaming technologies"
|
|
||||||
HOMEPAGE="http://dear-esther.com/"
|
|
||||||
SRC_URI="dearesther-linux-${TIMESTAMP}-bin
|
|
||||||
linguas_ru? ( http://www.dear-esther.com/translations/DE_Russian.rar )"
|
|
||||||
|
|
||||||
LICENSE="all-rights-reserved"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="-* ~amd64 ~x86"
|
|
||||||
IUSE="linguas_ru"
|
|
||||||
RESTRICT="bindist fetch splitdebug"
|
|
||||||
|
|
||||||
MYGAMEDIR=${GAMES_PREFIX_OPT}/${PN}
|
|
||||||
QA_PREBUILT="${MYGAMEDIR#/}/dearesther_linux
|
|
||||||
${MYGAMEDIR#/}/bin/*.so*"
|
|
||||||
|
|
||||||
DEPEND="
|
|
||||||
app-arch/unzip
|
|
||||||
app-arch/unrar
|
|
||||||
"
|
|
||||||
RDEPEND="
|
|
||||||
>=media-libs/freetype-2.5.0.1[abi_x86_32(-)]
|
|
||||||
>=media-libs/libsdl-1.2.15-r5[abi_x86_32(-)]
|
|
||||||
>=media-libs/openal-1.15.1[abi_x86_32(-)]
|
|
||||||
x11-libs/libX11[abi_x86_32(-)]
|
|
||||||
virtual/opengl[abi_x86_32(-)]
|
|
||||||
"
|
|
||||||
|
|
||||||
S=${WORKDIR}/data
|
|
||||||
|
|
||||||
pkg_nofetch() {
|
|
||||||
einfo "Please buy & download dearesther-linux-${TIMESTAMP}-bin from:"
|
|
||||||
einfo " ${HOMEPAGE}"
|
|
||||||
einfo "and move it to ${DISTDIR}"
|
|
||||||
einfo
|
|
||||||
if use linguas_ru; then
|
|
||||||
einfo "Also, please download http://www.dear-esther.com/translations/DE_Russian.rar"
|
|
||||||
einfo "if you want full russian localization"
|
|
||||||
einfo
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack_zip "dearesther-linux-${TIMESTAMP}-bin"
|
|
||||||
if use linguas_ru; then
|
|
||||||
mkdir "${WORKDIR}/russian" || die
|
|
||||||
pushd "${WORKDIR}/russian" &>/dev/null || die
|
|
||||||
unrar e "${DISTDIR}/DE_Russian.rar" || die 'unpacking of russian localization failed'
|
|
||||||
rm *.rtf || die 'remove uneeded guide'
|
|
||||||
# Workaround to broken subtitle support
|
|
||||||
mv closecaption_{russian,english}.txt || die
|
|
||||||
mv closecaption_{russian,english}.dat || ide
|
|
||||||
#
|
|
||||||
mv * "${WORKDIR}/data/dearesther/resource" || die
|
|
||||||
popd &>/dev/null
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
insinto "${MYGAMEDIR}"
|
|
||||||
doins -r bin dearesther platform dearesther_linux
|
|
||||||
|
|
||||||
doicon -s 256 dearesther.png
|
|
||||||
make_desktop_entry "${PN}" "Dear Esther" dearesther
|
|
||||||
if use linguas_ru; then
|
|
||||||
games_make_wrapper ${PN} "./dearesther_linux -game dearesther -language russian" "${MYGAMEDIR}" "${MYGAMEDIR}/bin"
|
|
||||||
else
|
|
||||||
games_make_wrapper ${PN} "./dearesther_linux -game dearesther" "${MYGAMEDIR}" "${MYGAMEDIR}/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dodoc README-linux.txt
|
|
||||||
|
|
||||||
fperms +x "${MYGAMEDIR}"/dearesther_linux
|
|
||||||
|
|
||||||
prepgamesdirs
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_preinst() {
|
|
||||||
games_pkg_preinst
|
|
||||||
gnome2_icon_savelist
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
games_pkg_postinst
|
|
||||||
gnome2_icon_cache_update
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postrm() {
|
|
||||||
gnome2_icon_cache_update
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
|
||||||
<pkgmetadata>
|
|
||||||
<maintainer>
|
|
||||||
<email>admin@pinkbyte.ru</email>
|
|
||||||
<name>Sergey Popov</name>
|
|
||||||
</maintainer>
|
|
||||||
</pkgmetadata>
|
|
@ -1,2 +0,0 @@
|
|||||||
DIST arpwatch-2.1a15.tar.gz 202729 SHA256 c1df9737e208a96a61fa92ddad83f4b4d9be66f8992f3c917e9edf4b05ff5898
|
|
||||||
DIST arpwatch-patchset-0.4.tbz2 16350 SHA256 f49deed64301078a00881fa9c27bb3a4116b9096cfe880f5a0bcc9913b439a18
|
|
@ -1,72 +0,0 @@
|
|||||||
# Copyright 1999-2010 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/arpwatch/arpwatch-2.1.15-r5.ebuild,v 1.7 2010/04/12 12:53:41 aballier Exp $
|
|
||||||
|
|
||||||
inherit eutils versionator
|
|
||||||
|
|
||||||
PATCH_VER="0.4"
|
|
||||||
|
|
||||||
MY_P="${PN}-$(replace_version_separator 2 'a')"
|
|
||||||
DESCRIPTION="An ethernet monitor program that keeps track of ethernet/ip address pairings"
|
|
||||||
HOMEPAGE="http://www-nrg.ee.lbl.gov/"
|
|
||||||
SRC_URI="ftp://ftp.ee.lbl.gov/${MY_P}.tar.gz
|
|
||||||
mirror://gentoo/arpwatch-patchset-${PATCH_VER}.tbz2"
|
|
||||||
|
|
||||||
LICENSE="BSD"
|
|
||||||
SLOT="0"
|
|
||||||
KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 ~x86-fbsd"
|
|
||||||
IUSE="selinux"
|
|
||||||
|
|
||||||
DEPEND="virtual/libpcap
|
|
||||||
sys-libs/ncurses"
|
|
||||||
|
|
||||||
RDEPEND="${DEPEND}
|
|
||||||
selinux? ( sec-policy/selinux-arpwatch )"
|
|
||||||
|
|
||||||
S=${WORKDIR}/${MY_P}
|
|
||||||
|
|
||||||
pkg_preinst() {
|
|
||||||
enewuser arpwatch
|
|
||||||
}
|
|
||||||
|
|
||||||
src_unpack() {
|
|
||||||
unpack ${A}
|
|
||||||
cd "${S}"
|
|
||||||
|
|
||||||
EPATCH_SOURCE="${WORKDIR}"/arpwatch-patchset/
|
|
||||||
EPATCH_SUFFIX="patch"
|
|
||||||
epatch
|
|
||||||
cp "${WORKDIR}"/arpwatch-patchset/*.8 . || die "Failed to get man-pages from arpwatch-patchset."
|
|
||||||
# Pinkbyte & Rainer: adapt nomail patch to current version and all previous patches (puts log files into /var/log/arpwatch folder)
|
|
||||||
epatch "${FILESDIR}/arpwatch_nomail-${PV}.patch"
|
|
||||||
#
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install () {
|
|
||||||
dosbin arpwatch arpsnmp arp2ethers massagevendor arpfetch bihourly.sh
|
|
||||||
doman arpwatch.8 arpsnmp.8 arp2ethers.8 massagevendor.8 arpfetch.8 bihourly.8
|
|
||||||
|
|
||||||
insinto /usr/share/arpwatch
|
|
||||||
doins ethercodes.dat
|
|
||||||
|
|
||||||
insinto /usr/share/arpwatch/awk
|
|
||||||
doins duplicates.awk euppertolower.awk p.awk e.awk d.awk
|
|
||||||
|
|
||||||
keepdir /var/lib/arpwatch
|
|
||||||
dodoc README CHANGES
|
|
||||||
|
|
||||||
newinitd "${FILESDIR}"/arpwatch.initd arpwatch
|
|
||||||
newconfd "${FILESDIR}"/arpwatch.confd arpwatch
|
|
||||||
# Pinkbyte: create directory /var/log/arpwatch and set it's owner to arpwatch user
|
|
||||||
keepdir /var/log/arpwatch
|
|
||||||
chown arpwatch:0 "${ROOT}var/log/arpwatch"
|
|
||||||
#
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
|
||||||
# Workaround bug #141619 put this in src_install when bug'll be fixed.
|
|
||||||
chown arpwatch:0 "${ROOT}var/lib/arpwatch"
|
|
||||||
|
|
||||||
elog "For security reasons arpwatch by default runs as an unprivileged user."
|
|
||||||
ewarn "Note: some scripts require snmpwalk utility from net-analyzer/net-snmp"
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
# Config file for /etc/init.d/arpwatch
|
|
||||||
# see arpwatch.8 for more information
|
|
||||||
|
|
||||||
#IFACES="eth0 eth1"
|
|
||||||
IFACES="eth0"
|
|
||||||
|
|
||||||
# Additional options to pass to arpwatch.
|
|
||||||
OPTIONS="-N -p"
|
|
||||||
|
|
||||||
# Comment this line if you wish arpwatch to run as root user (not recommended)
|
|
||||||
ARPUSER="arpwatch"
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/sbin/runscript
|
|
||||||
# Copyright 1999-2006 Gentoo Foundation
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/arpwatch/files/arpwatch.initd,v 1.1 2007/06/02 22:37:16 jokey Exp $
|
|
||||||
|
|
||||||
depend() {
|
|
||||||
need net
|
|
||||||
}
|
|
||||||
|
|
||||||
start() {
|
|
||||||
for IFACE in ${IFACES}
|
|
||||||
do
|
|
||||||
ebegin "Starting arpwatch on ${IFACE}"
|
|
||||||
DATAFILE=/var/lib/arpwatch/${IFACE}.dat
|
|
||||||
[ ! -f ${DATAFILE} ] && touch ${DATAFILE}
|
|
||||||
|
|
||||||
if [ -z ${ARPUSER} ]; then
|
|
||||||
start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \
|
|
||||||
/usr/sbin/arpwatch -- -i ${IFACE} -f ${DATAFILE} -P /var/run/arpwatch.${IFACE}.pid ${OPTIONS}
|
|
||||||
else
|
|
||||||
chown ${ARPUSER} ${DATAFILE}
|
|
||||||
start-stop-daemon --start --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \
|
|
||||||
/usr/sbin/arpwatch -- -i $IFACE -u ${ARPUSER} -f ${DATAFILE} -P /var/run/arpwatch.${IFACE}.pid ${OPTIONS}
|
|
||||||
fi
|
|
||||||
eend $?
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
for IFACE in ${IFACES}
|
|
||||||
do
|
|
||||||
ebegin "Stopping arpwatch on ${IFACE}"
|
|
||||||
start-stop-daemon --stop --quiet --pidfile=/var/run/arpwatch.${IFACE}.pid --exec \
|
|
||||||
/usr/sbin/arpwatch
|
|
||||||
eend $?
|
|
||||||
done
|
|
||||||
}
|
|
@ -1,181 +0,0 @@
|
|||||||
--- report.c.orig 2010-08-11 21:27:04.936004908 +0400
|
|
||||||
+++ report.c 2010-08-11 21:36:40.581758034 +0400
|
|
||||||
@@ -50,9 +50,7 @@
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <syslog.h>
|
|
||||||
-#ifdef TIME_WITH_SYS_TIME
|
|
||||||
#include <time.h>
|
|
||||||
-#endif
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "gnuc.h"
|
|
||||||
@@ -70,11 +68,15 @@
|
|
||||||
|
|
||||||
#define PLURAL(n) ((n) == 1 || (n) == -1 ? "" : "s")
|
|
||||||
|
|
||||||
-static int cdepth; /* number of outstanding children */
|
|
||||||
+#if !defined(REPORT_DIR)
|
|
||||||
+#define REPORT_DIR "/var/log/arpwatch"
|
|
||||||
+#endif
|
|
||||||
+#if !defined(REPORT_FMODE)
|
|
||||||
+#define REPORT_FMODE 644
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
static char *fmtdate(time_t);
|
|
||||||
static char *fmtdelta(time_t);
|
|
||||||
-RETSIGTYPE reaper(int);
|
|
||||||
static int32_t gmt2local(void);
|
|
||||||
|
|
||||||
static char *
|
|
||||||
@@ -203,44 +205,6 @@
|
|
||||||
return (dt);
|
|
||||||
}
|
|
||||||
|
|
||||||
-RETSIGTYPE
|
|
||||||
-reaper(int signo)
|
|
||||||
-{
|
|
||||||
- register pid_t pid;
|
|
||||||
- DECLWAITSTATUS status;
|
|
||||||
-
|
|
||||||
- for (;;) {
|
|
||||||
- pid = waitpid((pid_t)0, &status, WNOHANG);
|
|
||||||
- if ((int)pid < 0) {
|
|
||||||
- /* ptrace foo */
|
|
||||||
- if (errno == EINTR)
|
|
||||||
- continue;
|
|
||||||
- /* ECHILD means no one left */
|
|
||||||
- if (errno != ECHILD)
|
|
||||||
- /* It is dangerous to call non reentrant */
|
|
||||||
- /* functions from callback (POSIX) */
|
|
||||||
- /* Next line effectively disables this as */
|
|
||||||
- /* we never get here in debug */
|
|
||||||
- if (debug)
|
|
||||||
- syslog(LOG_ERR, "reaper: %m");
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- /* Already got everyone who was done */
|
|
||||||
- if (pid == 0)
|
|
||||||
- break;
|
|
||||||
- --cdepth;
|
|
||||||
- if (WEXITSTATUS(status))
|
|
||||||
- /* It is dangerous to call non-reentrant */
|
|
||||||
- /* functions from callback (POSIX) */
|
|
||||||
- /* Next line effectively disables this as */
|
|
||||||
- /* we never get here in debug */
|
|
||||||
- if (debug)
|
|
||||||
- syslog(LOG_DEBUG, "reaper: pid %d, exit status %d",
|
|
||||||
- pid, WEXITSTATUS(status));
|
|
||||||
- }
|
|
||||||
- return RETSIGVAL;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
void
|
|
||||||
report(register char *title, register u_int32_t a, register u_char *e1,
|
|
||||||
register u_char *e2, register time_t *t1p, register time_t *t2p,
|
|
||||||
@@ -248,16 +212,12 @@
|
|
||||||
{
|
|
||||||
extern char *path_sendmail;
|
|
||||||
register char *cp, *hn;
|
|
||||||
- register int fd, pid;
|
|
||||||
+ register int fd;
|
|
||||||
register FILE *f;
|
|
||||||
- char tempfile[64], cpu[64], os[64];
|
|
||||||
+ char tempfile[512], cpu[64], os[64];
|
|
||||||
char *fmt = "%20s: %s\n";
|
|
||||||
- char *watcher = mailaddress;
|
|
||||||
- char *watchee = WATCHEE;
|
|
||||||
- char *sendmail = path_sendmail;
|
|
||||||
char *unknown = "<unknown>";
|
|
||||||
char buf[132];
|
|
||||||
- static int init = 0;
|
|
||||||
|
|
||||||
/* No report until we're initialized */
|
|
||||||
if (initializing)
|
|
||||||
@@ -271,53 +271,34 @@
|
|
||||||
f = stdout;
|
|
||||||
(void)putc('\n', f);
|
|
||||||
} else {
|
|
||||||
- /* Setup child reaper if we haven't already */
|
|
||||||
- if (!init) {
|
|
||||||
- (void)setsignal(SIGCHLD, reaper);
|
|
||||||
- ++init;
|
|
||||||
- }
|
|
||||||
- while (cdepth >= 3) {
|
|
||||||
- syslog(LOG_ERR, "report: pausing (cdepth %d)", cdepth);
|
|
||||||
- pause();
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* Syslog this event too */
|
|
||||||
- dosyslog(LOG_NOTICE, title, a, e1, e2, interface);
|
|
||||||
-
|
|
||||||
/* return if watcher is an empty string */
|
|
||||||
if ( quiet )
|
|
||||||
return;
|
|
||||||
|
|
||||||
- /* Update child depth */
|
|
||||||
- ++cdepth;
|
|
||||||
-
|
|
||||||
- /* Fork off child to send mail */
|
|
||||||
- pid = fork();
|
|
||||||
- if (pid) {
|
|
||||||
- /* Parent */
|
|
||||||
- if (pid < 0)
|
|
||||||
- syslog(LOG_ERR, "report: fork() 1: %m");
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
+ time_t tt = time(NULL);
|
|
||||||
+ struct tm *t = localtime(&tt);
|
|
||||||
|
|
||||||
/* Child */
|
|
||||||
closelog();
|
|
||||||
(void)strcpy(tempfile, "/tmp/arpwatch.XXXXXX");
|
|
||||||
+ (void)snprintf(tempfile, sizeof(tempfile),
|
|
||||||
+ "%s/arpwatch-%04d%02d%02d_%02d%02d%02d.msgXXXXXX",
|
|
||||||
+ REPORT_DIR,
|
|
||||||
+ t->tm_year, t->tm_mon, t->tm_mday,
|
|
||||||
+ t->tm_hour, t->tm_min, t->tm_sec);
|
|
||||||
if ((fd = mkstemp(tempfile)) < 0) {
|
|
||||||
syslog(LOG_ERR, "mkstemp(%s) %m", tempfile);
|
|
||||||
+ return;
|
|
||||||
- exit(1);
|
|
||||||
}
|
|
||||||
+#if defined(REPORT_FMODE)
|
|
||||||
+ fchmod(fd, REPORT_FMODE);
|
|
||||||
+#endif
|
|
||||||
if ((f = fdopen(fd, "w+")) == NULL) {
|
|
||||||
- syslog(LOG_ERR, "child fdopen(%s): %m", tempfile);
|
|
||||||
- exit(1);
|
|
||||||
+ syslog(LOG_ERR, "fdopen(%s): %m", tempfile);
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
- /* Cheap delete-on-close */
|
|
||||||
- if (unlink(tempfile) < 0)
|
|
||||||
- syslog(LOG_ERR, "unlink(%s): %m", tempfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)fprintf(f, "From: %s\n", watchee);
|
|
||||||
- (void)fprintf(f, "To: %s\n", watcher);
|
|
||||||
if (interface == NULL) interface = ""; /* shouldn't happen */
|
|
||||||
hn = gethname(a);
|
|
||||||
if (!isdigit(*hn))
|
|
||||||
@@ -354,17 +354,7 @@
|
|
||||||
|
|
||||||
if (debug) {
|
|
||||||
fflush(f);
|
|
||||||
- return;
|
|
||||||
+ } else {
|
|
||||||
+ fclose(f);
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- (void)rewind(f);
|
|
||||||
- if (dup2(fileno(f), fileno(stdin)) < 0) {
|
|
||||||
- syslog(LOG_ERR, "dup2: %m");
|
|
||||||
- exit(1);
|
|
||||||
- }
|
|
||||||
- /* XXX Need to freopen()? */
|
|
||||||
- /* Always Deliver interactively (pause when child depth gets large) */
|
|
||||||
- execl(sendmail, "sendmail", "-odi", watcher, NULL);
|
|
||||||
- syslog(LOG_ERR, "execl: %s: %m", sendmail);
|
|
||||||
- exit(1);
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user