summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatsuu Takuto <matsuu@gentoo.org>2009-06-07 23:42:50 +0000
committerMatsuu Takuto <matsuu@gentoo.org>2009-06-07 23:42:50 +0000
commit669625bbf002c6a2f6500437353a18050f062403 (patch)
tree555e92b46bc6fe9cc03a506ae70ac31025ae5783 /net-misc/scponly
parentStable for HPPA (bug #272244). (diff)
downloadhistorical-669625bbf002c6a2f6500437353a18050f062403.tar.gz
historical-669625bbf002c6a2f6500437353a18050f062403.tar.bz2
historical-669625bbf002c6a2f6500437353a18050f062403.zip
fixed to emerge with gcc-4.4, bug #269242.
Package-Manager: portage-2.1.6.13/cvs/Linux x86_64
Diffstat (limited to 'net-misc/scponly')
-rw-r--r--net-misc/scponly/ChangeLog10
-rw-r--r--net-misc/scponly/Manifest4
-rw-r--r--net-misc/scponly/files/scponly-4.8-gcc4.4.0.patch15
-rw-r--r--net-misc/scponly/scponly-4.8-r3.ebuild298
4 files changed, 324 insertions, 3 deletions
diff --git a/net-misc/scponly/ChangeLog b/net-misc/scponly/ChangeLog
index 3397f5fa6d29..bb9be2871e01 100644
--- a/net-misc/scponly/ChangeLog
+++ b/net-misc/scponly/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/scponly
-# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/scponly/ChangeLog,v 1.42 2009/03/18 14:56:17 matsuu Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/scponly/ChangeLog,v 1.43 2009/06/07 23:42:50 matsuu Exp $
+
+*scponly-4.8-r3 (07 Jun 2009)
+
+ 07 Jun 2009; MATSUU Takuto <matsuu@gentoo.org> +scponly-4.8-r3.ebuild,
+ +files/scponly-4.8-gcc4.4.0.patch:
+ fixed to emerge with gcc-4.4, bug #269242.
*scponly-4.8-r2 (18 Mar 2009)
diff --git a/net-misc/scponly/Manifest b/net-misc/scponly/Manifest
index e286c8584c60..a3bbcb3d29f4 100644
--- a/net-misc/scponly/Manifest
+++ b/net-misc/scponly/Manifest
@@ -1,7 +1,9 @@
+AUX scponly-4.8-gcc4.4.0.patch 571 RMD160 acb834c4fba11b7f412c930b74ffba6782acf579 SHA1 6b1e6dc884121709d0490dd8b37507826ee1779a SHA256 bf89c4b56552654140c93b5cf3090370c24ee20e5870f0cf0df76218e52e15b2
AUX scponly-4.8-rsync.patch 7838 RMD160 fc7464eeab781ed51ba85b8120489e10b9db1442 SHA1 992e58ddc5ea7334cf9b72324a96f149b298c210 SHA256 bfab1408ad8cfdfd8fc7f9b583c57a5c6b73be36cb3955db46e4c892acd7e55e
DIST scponly-4.8.tgz 101687 RMD160 de6b58fcb8108d42a1576c69003e9136b9417869 SHA1 154de34901ce22fd9d406f6e02cddc440c435afc SHA256 1693dd678355749c5d9e48ecdd4628dbfe71d82955afde950ee8d88b5adc01cf
EBUILD scponly-4.8-r1.ebuild 8903 RMD160 3d8cb5017aeb1a0757c536d2c725320b65122e01 SHA1 90299bcae8b562f2112e63f10eb5d720a3293323 SHA256 f3f19a50e52c52012f31a589e3b88a12fbb0818a54b9a92433041b9281a61420
EBUILD scponly-4.8-r2.ebuild 8992 RMD160 1e5ce20bac50f1d4ce2f30e0e2d4dc1317ba9831 SHA1 bc317f4b3660bfa2f5c4fed198436c2df5518210 SHA256 0b832b322733cce99806d5be1dd86cde459d76dd28b6ffbcf4aefd4e1e3b42b1
+EBUILD scponly-4.8-r3.ebuild 9049 RMD160 738040d742bd6ce07155e7996cd4a03e89aad05e SHA1 7df7e1402591360144076607e5b1941ddb3bae6e SHA256 89048b3f8b617f6d07fa52559825054057e8eac95945e3568ad599ef498655ac
EBUILD scponly-4.8.ebuild 4283 RMD160 2e555f2bf02554ccf2c6005476c90e637690e3be SHA1 a73ad3c22ba463951c3827f5b1a515fd3e621a13 SHA256 ea3d3d88d8079353a846129de71679bcdf7021f2f91593a0ee95d218a9c11a90
-MISC ChangeLog 6271 RMD160 318325f5bd137eaea11b3cb6371f12266c814e05 SHA1 c51070926959a8f4f54ed4a61d4d15dd11c5cca4 SHA256 716a390f514d98cb0e09d5def74fd29adaf0fb6adf570c57add9c47a7b049343
+MISC ChangeLog 6458 RMD160 2dac7f152021592dff473feaadbb66ee37a12050 SHA1 70abcfcf57a646ba4a2ed609924c3e7a0135c10c SHA256 27f40667e9fae128736355387a72c000477382fe98c04e1322f09914340eeb36
MISC metadata.xml 1424 RMD160 bedfada17f8ebfb8964a627769b1f6f96114ada4 SHA1 c7063171c58a7d6195e291232b96820957df8fbf SHA256 39e481515e78825063291d053dd92d5652d0c824b706e67dadaccecdcad491e2
diff --git a/net-misc/scponly/files/scponly-4.8-gcc4.4.0.patch b/net-misc/scponly/files/scponly-4.8-gcc4.4.0.patch
new file mode 100644
index 000000000000..d08ce28b93b5
--- /dev/null
+++ b/net-misc/scponly/files/scponly-4.8-gcc4.4.0.patch
@@ -0,0 +1,15 @@
+--- helper.c.orig 2009-05-11 00:33:08.000000000 -0600
++++ helper.c 2009-05-11 00:39:59.000000000 -0600
+@@ -259,11 +259,11 @@
+ PROG_RSYNC, logstamp());
+ return 1;
+ }
+ #endif /* RSYNC_COMPAT */
+
+-#elif /* HAVE_GETOPT */
++#else /* HAVE_GETOPT */
+ /*
+ * make sure that processing doesn't continue if we can't validate a rsync check
+ * and if the getopt flag is set.
+ */
+ syslog(LOG_ERR, "a getopt() argument check could not be performed for %s, recompile scponly without support for %s or rebuild scponly with getopt", av[0], av[0]);
diff --git a/net-misc/scponly/scponly-4.8-r3.ebuild b/net-misc/scponly/scponly-4.8-r3.ebuild
new file mode 100644
index 000000000000..b1be5b8c530b
--- /dev/null
+++ b/net-misc/scponly/scponly-4.8-r3.ebuild
@@ -0,0 +1,298 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/scponly/scponly-4.8-r3.ebuild,v 1.1 2009/06/07 23:42:50 matsuu Exp $
+
+EAPI="1"
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="A tiny pseudoshell which only permits scp and sftp"
+HOMEPAGE="http://www.sublimation.org/scponly/"
+SRC_URI="mirror://sourceforge/scponly/${P}.tgz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~ppc ~sparc ~x86"
+IUSE="+sftp scp winscp gftp rsync unison subversion wildcards quota passwd logging"
+
+RDEPEND="virtual/libc
+ sys-apps/sed
+ net-misc/openssh
+ quota? ( sys-fs/quota )
+ !mips? ( passwd? ( sys-apps/shadow ) )
+ rsync? ( net-misc/rsync )
+ !mips? ( unison? ( net-misc/unison ) )
+ subversion? ( dev-util/subversion )"
+DEPEND="${RDEPEND}"
+
+myuser="scponly"
+myhome="/home/${myuser}"
+mysubdir="/pub"
+
+pkg_setup() {
+ if use mips; then
+ if use unison || use passwd; then
+ eerror
+ eerror "unison and passwd use-flags are not supported on mips yet!"
+ die "unsupported use-flags for your arch"
+ fi
+ fi
+
+ if use unison; then
+ if [ ! -e "${ROOT}usr/bin/unison" ]; then
+ eerror
+ eerror "please run 'eselect unison set <version>' first!"
+ die "can't find /usr/bin/unison"
+ fi
+ fi
+
+ if ! use subversion && ! use unison && ! use rsync && \
+ ! use sftp && ! use scp && ! use winscp; then
+ eerror
+ eerror "you have to enable at least one of the following use-flags:"
+ eerror "sftp scp winscp rsync unison subversion"
+ die "your build will quite useless without any compatibility mode"
+ fi
+
+ if use subversion || use unison || use rsync || use wildcards || use scp || use winscp; then
+ ewarn
+ ewarn "NOTE THE FOLLOWING SECURITY RISKS:"
+ ewarn
+ if use wildcards; then
+ ewarn "-- by enabling wildcards, there is a slightly higher chance of an exploit"
+ fi
+ if use scp || use winscp; then
+ ewarn "-- by enabling scp and/or winscp compatibility, more programs will need"
+ ewarn " to be installed in the chroot which increases the risk."
+ fi
+ if use subversion; then
+ ewarn "-- CAUTION: by enabling subversion the user WILL BE ABLE TO EXECUTE"
+ ewarn " SCRIPTS OR PROGRAMS INDIRECTLY! svn and svnserve will try to execute"
+ ewarn " pre-commit, post-commit hooks, as well as a few others. These files"
+ ewarn " have specific filenames at specific locations relative to the svn"
+ ewarn " repository root. Thus, unless you are *very* careful about security,"
+ ewarn " the user WILL BE ABLE TO EXECUTE SCRIPTS OR PROGRAMS INDIRECTLY!"
+ ewarn " This can be prevented by a careful configuration."
+ fi
+ if use subversion || use unison || use rsync; then
+ ewarn "-- The following programs use configuration files that might allow the"
+ ewarn " user to bypass security restrictions placed on command line arguments:"
+ ewarn " svn, svnserve, rsync, unison"
+ fi
+ ewarn
+ ewarn "please read /usr/share/doc/${PF}/SECURITY* after install!"
+ ewarn
+ ebeep 5
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-rsync.patch"
+ # bug #269242
+ epatch "${FILESDIR}/${P}-gcc4.4.0.patch"
+}
+
+src_compile() {
+ CFLAGS="${CFLAGS} ${LDFLAGS}" econf \
+ --with-sftp-server="/usr/$(get_libdir)/misc/sftp-server" \
+ --with-default-chdir="/" \
+ --disable-restrictive-names \
+ --enable-chrooted-binary \
+ --enable-chroot-checkdir \
+ $(use_enable winscp winscp-compat) \
+ $(use_enable gftp gftp-compat) \
+ $(use_enable scp scp-compat) \
+ $(use_enable sftp sftp) \
+ $(use_enable quota quota-compat) \
+ $(use_enable passwd passwd-compat) \
+ $(use_enable rsync rsync-compat) \
+ $(use_enable unison unison-compat) \
+ $(use_enable subversion svn-compat) \
+ $(use_enable subversion svnserv-compat) \
+ $(use_enable logging sftp-logging-compat) \
+ $(use_enable wildcards wildcards) \
+ || die "econf failed"
+ emake CC=$(tc-getCC) || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ dodoc AUTHOR BUILDING-JAILS.TXT CHANGELOG CONTRIB README SECURITY TODO
+
+ # don't compress setup-script, so it is usable if necessary
+ insinto /usr/share/doc/${PF}/chroot
+ doins setup_chroot.sh config.h
+}
+
+pkg_postinst() {
+ elog
+ elog "You might want to run"
+ elog " emerge --config =${CATEGORY}/${PF}"
+ elog "to setup the chroot. Otherwise you will have to setup chroot manually."
+ elog
+ elog "Please read the docs in /usr/share/doc/${PF} for more informations!"
+ elog
+
+ # two slashes ('//') are used by scponlyc to determine the chroot point.
+ enewgroup "${myuser}"
+ enewuser "${myuser}" -1 /usr/sbin/scponlyc "${myhome}//" "${myuser}"
+}
+
+pkg_config() {
+ # pkg_postinst is based on ${S}/setup_chroot.sh.
+
+ einfo "Collecting binaries and libraries..."
+
+ # Binaries launched in sftp compat mode
+ if built_with_use =${CATEGORY}/${PF} sftp; then
+ BINARIES="/usr/$(get_libdir)/misc/sftp-server"
+ fi
+
+ # Binaries launched by vanilla- and WinSCP modes
+ if built_with_use =${CATEGORY}/${PF} scp || \
+ built_with_use =${CATEGORY}/${PF} winscp; then
+ BINARIES="${BINARIES} /usr/bin/scp /bin/ls /bin/rm /bin/ln /bin/mv"
+ BINARIES="${BINARIES} /bin/chmod /bin/chown /bin/chgrp /bin/mkdir /bin/rmdir"
+ fi
+
+ # Binaries launched in WinSCP compatibility mode
+ if built_with_use =${CATEGORY}/${PF} winscp; then
+ BINARIES="${BINARIES} /bin/pwd /bin/groups /usr/bin/id /bin/echo"
+ fi
+
+ # Rsync compatability mode
+ if built_with_use =${CATEGORY}/${PF} rsync; then
+ BINARIES="${BINARIES} /usr/bin/rsync"
+ fi
+
+ # Unison compatability mode
+ if built_with_use =${CATEGORY}/${PF} unison; then
+ BINARIES="${BINARIES} /usr/bin/unison"
+ fi
+
+ # subversion cli/svnserv compatibility
+ if built_with_use =${CATEGORY}/${PF} subversion; then
+ BINARIES="${BINARIES} /usr/bin/svn /usr/bin/svnserve"
+ fi
+
+ # passwd compatibility
+ if built_with_use =${CATEGORY}/${PF} passwd; then
+ BINARIES="${BINARIES} /bin/passwd"
+ fi
+
+ # quota compatibility
+ if built_with_use =${CATEGORY}/${PF} quota; then
+ BINARIES="${BINARIES} /usr/bin/quota"
+ fi
+
+ # build lib dependencies
+ LIB_LIST=$(ldd ${BINARIES} | sed -n 's:.* => \(/[^ ]\+\).*:\1:p' | sort -u)
+
+ # search and add ld*.so
+ for LIB in /$(get_libdir)/ld.so /libexec/ld-elf.so /libexec/ld-elf.so.1 \
+ /usr/libexec/ld.so /$(get_libdir)/ld-linux.so.2 /usr/libexec/ld-elf.so.1; do
+ [ -f "${LIB}" ] && LIB_LIST="${LIB_LIST} ${LIB}"
+ done
+
+ # search and add libnss_*.so
+ for LIB in /$(get_libdir)/libnss_{compat,files}*.so.*; do
+ [ -f "${LIB}" ] && LIB_LIST="${LIB_LIST} ${LIB}"
+ done
+
+ # create base dirs
+ if [ ! -d "${myhome}" ]; then
+ einfo "Creating ${myhome}"
+ install -o0 -g0 -m0755 -d "${myhome}"
+ fi
+
+ if [ ! -d "${myhome}/etc" ]; then
+ einfo "Creating ${myhome}/etc"
+ install -o0 -g0 -m0755 -d "${myhome}/etc"
+ fi
+
+ if [ ! -d "${myhome}/$(get_libdir)" ]; then
+ einfo "Creating ${myhome}/$(get_libdir)"
+ install -o0 -g0 -m0755 -d "${myhome}/$(get_libdir)"
+ fi
+
+ if [ ! -e "${myhome}/lib" ]; then
+ einfo "Creating ${myhome}/lib"
+ ln -snf $(get_libdir) "${myhome}/lib"
+ fi
+
+ if [ ! -d "${myhome}/usr/$(get_libdir)" ]; then
+ einfo "Creating ${myhome}/usr/$(get_libdir)"
+ install -o0 -g0 -m0755 -d "${myhome}/usr/$(get_libdir)"
+ fi
+
+ if [ ! -e "${myhome}/usr/lib" ]; then
+ einfo "Creating ${myhome}/usr/lib"
+ ln -snf $(get_libdir) "${myhome}/usr/lib"
+ fi
+
+ if [ ! -d "${myhome}${mysubdir}" ]; then
+ einfo "Creating ${myhome}${mysubdir} directory for uploading files"
+ install -o${myuser} -g${myuser} -m0755 -d "${myhome}${mysubdir}"
+ fi
+
+ # create /dev/null (Bug 135505)
+ if [ ! -e "${myhome}/dev/null" ]; then
+ install -o0 -g0 -m0755 -d "${myhome}/dev"
+ mknod -m0777 "${myhome}/dev/null" c 1 3
+ fi
+
+ # install binaries
+ for BIN in ${BINARIES}; do
+ einfo "Install ${BIN}"
+ install -o0 -g0 -m0755 -d "${myhome}$(dirname ${BIN})"
+ if [ "${BIN}" = "/bin/passwd" ]; then # needs suid
+ install -p -o0 -g0 -m04711 "${BIN}" "${myhome}/${BIN}"
+ else
+ install -p -o0 -g0 -m0755 "${BIN}" "${myhome}/${BIN}"
+ fi
+ done
+
+ # install libs
+ for LIB in ${LIB_LIST}; do
+ einfo "Install ${LIB}"
+ install -o0 -g0 -m0755 -d "${myhome}$(dirname ${LIB})"
+ install -p -o0 -g0 -m0755 "${LIB}" "${myhome}/${LIB}"
+ done
+
+ # create ld.so.conf
+ einfo "Creating /etc/ld.so.conf"
+ for LIB in ${LIB_LIST}; do
+ dirname ${LIB}
+ done | sort -u | while read DIR; do
+ if ! grep 2>/dev/null -q "^${DIR}$" "${myhome}/etc/ld.so.conf"; then
+ echo "${DIR}" >> "${myhome}/etc/ld.so.conf"
+ fi
+ done
+ ldconfig -r "${myhome}"
+
+ # update shells
+ einfo "Updating /etc/shells"
+ grep 2>/dev/null -q "^/usr/bin/scponly$" /etc/shells \
+ || echo "/usr/bin/scponly" >> /etc/shells
+
+ grep 2>/dev/null -q "^/usr/sbin/scponlyc$" /etc/shells \
+ || echo "/usr/sbin/scponlyc" >> /etc/shells
+
+ # create /etc/passwd
+ if [ ! -e "${myhome}/etc/passwd" ]; then
+ (
+ echo "root:x:0:0:root:/:/bin/sh"
+ sed -n "s|^\(${myuser}:[^:]*:[^:]*:[^:]*:[^:]*:\).*|\1${mysubdir}:/bin/sh|p" /etc/passwd
+ ) > "${myhome}/etc/passwd"
+ fi
+
+ # create /etc/group
+ if [ ! -e "${myhome}/etc/group" ]; then
+ (
+ echo "root:x:0:"
+ sed -n "s|^\(${myuser}:[^:]*:[^:]*:\).*|\1|p" /etc/group
+ ) > "${myhome}/etc/group"
+ fi
+}