From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7A77A15808B for ; Tue, 1 Mar 2022 12:54:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B1076E07F1; Tue, 1 Mar 2022 12:54:28 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 61767E07F1 for ; Tue, 1 Mar 2022 12:54:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 20CAF3432A7 for ; Tue, 1 Mar 2022 12:54:27 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4D4BD2CB for ; Tue, 1 Mar 2022 12:54:25 +0000 (UTC) From: "Alexey Shvetsov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexey Shvetsov" Message-ID: <1646139253.3c5d8a46a252853fd8b54c8c6537e08b768fbc7a.alexxy@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: www-servers/webfs/files/, www-servers/webfs/ X-VCS-Repository: repo/gentoo X-VCS-Files: www-servers/webfs/Manifest www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch www-servers/webfs/files/webfs.confd www-servers/webfs/files/webfs.initd www-servers/webfs/files/webfs.service www-servers/webfs/files/webfs.service.conf www-servers/webfs/metadata.xml www-servers/webfs/webfs-1.21.ebuild X-VCS-Directories: www-servers/webfs/files/ www-servers/webfs/ X-VCS-Committer: alexxy X-VCS-Committer-Name: Alexey Shvetsov X-VCS-Revision: 3c5d8a46a252853fd8b54c8c6537e08b768fbc7a X-VCS-Branch: master Date: Tue, 1 Mar 2022 12:54:25 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 744b523f-44f0-45be-8abe-59c12196ca2a X-Archives-Hash: 2f472c093826de7413a2e06d5647f84b commit: 3c5d8a46a252853fd8b54c8c6537e08b768fbc7a Author: Alexey Shvetsov gentoo org> AuthorDate: Tue Mar 1 12:54:02 2022 +0000 Commit: Alexey Shvetsov gentoo org> CommitDate: Tue Mar 1 12:54:13 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c5d8a46 www-servers/webfs: Add webfsd Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Alexey Shvetsov gentoo.org> www-servers/webfs/Manifest | 1 + .../webfs/files/webfs-1.21-CVE-2013-0347.patch | 15 ++++++ ...riables.mk-dont-strip-binaries-on-install.patch | 12 +++++ www-servers/webfs/files/webfs.confd | 27 +++++++++++ www-servers/webfs/files/webfs.initd | 29 ++++++++++++ www-servers/webfs/files/webfs.service | 10 ++++ www-servers/webfs/files/webfs.service.conf | 27 +++++++++++ www-servers/webfs/metadata.xml | 8 ++++ www-servers/webfs/webfs-1.21.ebuild | 55 ++++++++++++++++++++++ 9 files changed, 184 insertions(+) diff --git a/www-servers/webfs/Manifest b/www-servers/webfs/Manifest new file mode 100644 index 000000000000..7736407698cb --- /dev/null +++ b/www-servers/webfs/Manifest @@ -0,0 +1 @@ +DIST webfs-1.21.tar.gz 44249 BLAKE2B 3d1bf7023f271f06079378a9a8e957deb611d567209ebd0ee947cae9852aecc2704ec8ce115b1f03ec39299040f44d7caf53fb30241f4990521aeda7b5815f3f SHA512 68b9b3163a21be8a549e395295b27dd8ce9b575183d6c36b05b98bdc310917cf2dc653ff73bdb78a8c063674a8e9480211ec5c28b8a676f9cee41fa962cfd473 diff --git a/www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch b/www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch new file mode 100644 index 000000000000..26e225def360 --- /dev/null +++ b/www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch @@ -0,0 +1,15 @@ +--- ./webfsd.c ++++ ./webfsd.c +@@ -918,8 +918,11 @@ + } else { + if (NULL == (logfh = fopen(logfile,"a"))) + xperror(LOG_WARNING,"open access log",NULL); +- else ++ else { + close_on_exec(fileno(logfh)); ++ if (0 != chmod(logfile,S_IRUSR|S_IWUSR)) ++ xperror(LOG_WARNING,"chmod access log",NULL); ++ } + } + } + diff --git a/www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch b/www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch new file mode 100644 index 000000000000..03f2f5c59816 --- /dev/null +++ b/www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch @@ -0,0 +1,12 @@ +diff -Naur webfs-1.21.orig/mk/Variables.mk webfs-1.21/mk/Variables.mk +--- webfs-1.21.orig/mk/Variables.mk 2009-02-03 01:14:18.000000000 +0100 ++++ webfs-1.21/mk/Variables.mk 2009-02-03 01:16:01.000000000 +0100 +@@ -23,7 +23,7 @@ + CXX ?= g++ + MOC ?= $(if $(QTDIR),$(QTDIR)/bin/moc,moc) + INSTALL ?= install +-INSTALL_BINARY := $(INSTALL) -s ++INSTALL_BINARY := $(INSTALL) + INSTALL_SCRIPT := $(INSTALL) + INSTALL_DATA := $(INSTALL) -m 644 + INSTALL_DIR := $(INSTALL) -d diff --git a/www-servers/webfs/files/webfs.confd b/www-servers/webfs/files/webfs.confd new file mode 100644 index 000000000000..5c4de3ad9b74 --- /dev/null +++ b/www-servers/webfs/files/webfs.confd @@ -0,0 +1,27 @@ +# Configuration for webfsd init script + +WEBFS_PORT=80 +WEBFS_DOCROOT=/var/www/localhost/htdocs +WEBFS_INDEX=index.html +WEBFS_LOG=/var/log/webfsd.log + +# set server name +#WEBFS_SERVNAME= + +# uncomment to chroot to specified dir +#WEBFS_CHROOT="/var/www/localhost" + +# max allowed connections (defaults to 32) +#WEBFS_MAXCONN=50 + +# uncomment to enable directory listings +#WEBFS_DIR_LIST=true + +# uncomment to enable SSL (you'll need to add -C -P to WEBFS_OPTS) +#WEBFS_SSL=true + +# uncomment to enable ipv6 +#WEBFS_IPV6=true + +# Add any extra options here. See webfsd for more information. +#WEBFS_OPTS="" diff --git a/www-servers/webfs/files/webfs.initd b/www-servers/webfs/files/webfs.initd new file mode 100644 index 000000000000..ec328b662f83 --- /dev/null +++ b/www-servers/webfs/files/webfs.initd @@ -0,0 +1,29 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +start() { + WEBFS_OPTS="-p ${WEBFS_PORT:-80} -f ${WEBFS_INDEX:-index.html} ${WEBFS_OPTS}" + [ -n "${WEBFS_DOCROOT}" ] && WEBFS_OPTS="${WEBFS_OPTS} -r ${WEBFS_DOCROOT}" + [ -n "${WEBFS_CHROOT}" ] && WEBFS_OPTS="${WEBFS_OPTS} -R ${WEBFS_CHROOT}" + [ -n "${WEBFS_LOG}" ] && WEBFS_OPTS="${WEBFS_OPTS} -L ${WEBFS_LOG}" + [ -n "${WEBFS_MAXCONN}" ] && WEBFS_OPTS="${WEBFS_OPTS} -c ${WEBFS_MAXCONN}" + [ -n "${WEBFS_IPV6}" ] && WEBFS_OPTS="${WEBFS_OPTS} -6" + [ -n "${WEBFS_SSL}" ] && WEBFS_OPTS="${WEBFS_OPTS} -S" + [ -n "${WEBFS_SERVNAME}" ] && WEBFS_OPTS="${WEBFS_OPTS} -n ${WEBFS_SERVNAME}" + [ -n "${WEBFS_DIR_LIST}" ] || WEBFS_OPTS="${WEBFS_OPTS} -j" + + ebegin "Starting webfsd" + start-stop-daemon --start --quiet --exec /usr/bin/webfsd -- ${WEBFS_OPTS} + eend $? "Failed to start webfsd" +} + +stop() { + ebegin "Stopping webfsd" + start-stop-daemon --stop --quiet --exec /usr/bin/webfsd + eend $? "Failed to stop webfsd" +} diff --git a/www-servers/webfs/files/webfs.service b/www-servers/webfs/files/webfs.service new file mode 100644 index 000000000000..f8857655e28f --- /dev/null +++ b/www-servers/webfs/files/webfs.service @@ -0,0 +1,10 @@ +[Unit] +Description=Simple and instant http server. +Documentation=man:webfsd(1) +After=network.target + +[Service] +ExecStart=/usr/bin/webfsd -p ${WEBFS_PORT:-80} -f ${WEBFS_INDEX:-index.html} ${WEBFS_OPTS} -F + +[Install] +WantedBy=multi-user.target diff --git a/www-servers/webfs/files/webfs.service.conf b/www-servers/webfs/files/webfs.service.conf new file mode 100644 index 000000000000..80daa14dc7ae --- /dev/null +++ b/www-servers/webfs/files/webfs.service.conf @@ -0,0 +1,27 @@ +# Configuration for webfsd + +WEBFS_PORT=80 +WEBFS_DOCROOT=/var/www/localhost/htdocs +WEBFS_INDEX=index.html +WEBFS_LOG=/var/log/webfsd.log + +# set server name +#WEBFS_SERVNAME= + +# uncomment to chroot to specified dir +#WEBFS_CHROOT="/var/www/localhost" + +# max allowed connections (defaults to 32) +#WEBFS_MAXCONN=50 + +# uncomment to enable directory listings +#WEBFS_DIR_LIST=true + +# uncomment to enable SSL (you'll need to add -C -P to WEBFS_OPTS) +#WEBFS_SSL=true + +# uncomment to enable ipv6 +#WEBFS_IPV6=true + +# Add any extra options here. See webfsd for more information. +#WEBFS_OPTS="" diff --git a/www-servers/webfs/metadata.xml b/www-servers/webfs/metadata.xml new file mode 100644 index 000000000000..34f42ecf020c --- /dev/null +++ b/www-servers/webfs/metadata.xml @@ -0,0 +1,8 @@ + + + + + alexxy@gentoo.org + Alexey Shvetsov + + diff --git a/www-servers/webfs/webfs-1.21.ebuild b/www-servers/webfs/webfs-1.21.ebuild new file mode 100644 index 000000000000..7b512f519cdf --- /dev/null +++ b/www-servers/webfs/webfs-1.21.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit systemd + +DESCRIPTION="Lightweight HTTP server for static content" +SRC_URI="http://dl.bytesex.org/releases/${PN}/${P}.tar.gz" +HOMEPAGE="http://linux.bytesex.org/misc/webfs.html" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ssl threads" + +DEPEND="ssl? ( dev-libs/openssl:0= )" + +RDEPEND="${DEPEND} + app-misc/mime-types" + +PATCHES=( + "${FILESDIR}/${P}-Variables.mk-dont-strip-binaries-on-install.patch" + "${FILESDIR}/${P}-CVE-2013-0347.patch" +) + +src_prepare() { + sed -e "s:/etc/mime.types:${EPREFIX}\\0:" -i GNUmakefile || die "sed failed" + default +} + +src_compile() { + local myconf + use ssl || myconf="${myconf} USE_SSL=no" + use threads && myconf="${myconf} USE_THREADS=yes" + + emake prefix="${EPREFIX}/usr" ${myconf} +} + +src_install() { + local myconf + use ssl || myconf="${myconf} USE_SSL=no" + use threads && myconf="${myconf} USE_THREADS=yes" + emake DESTDIR="${D}" install prefix="${EPREFIX}/usr" ${myconf} mandir="${ED}/usr/share/man" + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} + systemd_dounit "${FILESDIR}/${PN}.service" + systemd_install_serviced "${FILESDIR}/${PN}.service.conf" + dodoc README +} + +pkg_preinst() { + # Fix existing log permissions for bug #458892. + chmod 0600 "${EROOT}/var/log/webfsd.log" 2>/dev/null +}