From 0ec1e1dd7867c3dedcbea76c9b6e847d6b388c03 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 11 Feb 2025 00:12:38 +0000 Subject: gentoo auto-resync : 11:02:2025 - 00:12:37 --- net-misc/scponly/Manifest | 5 +- net-misc/scponly/files/scponly-4.8-C23.patch | 26 +++ net-misc/scponly/metadata.xml | 1 + net-misc/scponly/scponly-4.8-r8.ebuild | 245 -------------------------- net-misc/scponly/scponly-4.8-r9.ebuild | 252 +++++++++++++++++++++++++++ 5 files changed, 282 insertions(+), 247 deletions(-) create mode 100644 net-misc/scponly/files/scponly-4.8-C23.patch delete mode 100644 net-misc/scponly/scponly-4.8-r8.ebuild create mode 100644 net-misc/scponly/scponly-4.8-r9.ebuild (limited to 'net-misc/scponly') diff --git a/net-misc/scponly/Manifest b/net-misc/scponly/Manifest index 599524a8a4d3..a9a0a0a120e9 100644 --- a/net-misc/scponly/Manifest +++ b/net-misc/scponly/Manifest @@ -1,6 +1,7 @@ +AUX scponly-4.8-C23.patch 788 BLAKE2B 0e17192178f17143274dedc1efe131cae886d713549f158edd2904b8154f15de870fd8b8994407c8ed1a7f64394d5f20553479befb68b8cd88e3cc40f187db4a SHA512 b56fe9af6873a47daf978748a1b2e185bae285cb6f247483179857614c46a4549d0409b58bb583777940cfe7cd40959aeffbac3a60bfa561a05ba5b53f65ffbb AUX scponly-4.8-gcc4.4.0.patch 555 BLAKE2B 0eff2d5cd94f60540dd1bbb6b6f9f1486abbb25e4a32d6eab5c94e55a3d14b77e4724b7c1e70f8a39369becc554d20953bc9f43d44923582f41ed02adc37f665 SHA512 fd9727364591d528e17845eb3e103728382fa7b476b9c0331f16f3e09dc469df7068412047a30b554578887e7897e80574ac820314ec0dae5d58909e3bb5f7de AUX scponly-4.8-rsync.patch 7838 BLAKE2B 1d6191aee86b0e3e75e527dbb1f8dbf631940a34da3f29f36b0e55577555dc9ad02e2e787a8cd53aeab5a28d93da7dd528a486f1133fd7a04b91971774b4b2a1 SHA512 37885c9b46422ac034182f9c9f230b4e806ce8c894ebb6c621f0e2b3d5f46c91db902c2dae6aefe5471907025d400320e4eff37cc7c5cc4c6f7d8c88a38e53f8 AUX scponly-4.8-sftp-server-path.patch 2692 BLAKE2B ead282d46cb25a6d8606fa65e538142c15dd0be82956c2c8a48c7d46cc9ec59605a4f1c10fc5235acb584945b00ee4c187391d198571d841b45225c328765b49 SHA512 86171549d894426d12eb2f8d65959d1be2e137327c135be31c762820a55256f5c4ac90a01f989c8bffd2b46b275de408912306209b5aba9a94b81dbc06ff5a24 DIST scponly-4.8.tgz 101687 BLAKE2B aa7250464fa3b51a439d35418c64d49f8595eaac6ffe710137c7c53b96bcf66a5ead38e9520b2cead7a829b57520f988f873eb713d5f52045cba4ef02c8e9b61 SHA512 134c008a7377cef7b8e0be483df8413e162a515967147f561d23b72bdef3dfbe70a8313811dfff6372b88f15c1ac8a4385831fcf329261276993c64d5040f29b -EBUILD scponly-4.8-r8.ebuild 6944 BLAKE2B d28b0a4a066ea4cb345d4e7a1219de4b932f6e95bfab5cf968e0025420242909ec0d46e69d7ba8cd276fb10ec2e83021f17ec5c542b1b39cfde154a3febbefa9 SHA512 fbfb223bf0ed14e2632224d590363a9083b519ea3a16569c8e5dfa4cf676e550d801134ff40364af782df147ea7547edb0f48942faeda32fc328089fb1de8ca2 -MISC metadata.xml 1761 BLAKE2B a2fbdcc0e9b89e85180548a97a12eeb27a5d973673451972c32184dfc932d6634950e0620fa2a1e2962d8a08508c31439f9a3e29a6e2a3e4f76d53933ac425e5 SHA512 bdfe9ab129bc9c939850756b23510c91908c21aa417529501b2ada83a30335ce4446f5bbc6dcb728df09e1b27d4cf7ba4eee4f43b96a1b92c0ea476d05ca7592 +EBUILD scponly-4.8-r9.ebuild 7021 BLAKE2B 719addadd400fab7615cc2889f958092db87c97c453deae383e351f48d207a65ea50ac0061e7edd7cbdc12a829d00f5bdeb9f789010ae5e56a8516e00178887d SHA512 fea34003aef58478d02e77e97f5a759ca339522baf4aaa50e472f074f81d851ffa0efca7d5ffdd44897463687daa5f46d4a468754129e2452279ee5db5b75384 +MISC metadata.xml 1816 BLAKE2B 3fe231b9ced26d79b296de4230f5dee7a13414dfad5ef683fec8c993099c59a5ace44b2741b29915b6b4e557b9604b0cd7e4614a3b361880df043412a3ec2112 SHA512 ef9efd06597dfe02ae896b37f9ad94ff3742d0c82a05bccef4f1f70c0561056879f46efe94ff318fc7735e945d6d94c9200977ae2b2d5164ae0ce28c8c8989db diff --git a/net-misc/scponly/files/scponly-4.8-C23.patch b/net-misc/scponly/files/scponly-4.8-C23.patch new file mode 100644 index 000000000000..113451e75aab --- /dev/null +++ b/net-misc/scponly/files/scponly-4.8-C23.patch @@ -0,0 +1,26 @@ +diff -ru a/helper.c b/helper.c +--- a/helper.c 2025-01-10 17:16:03.332900358 +0400 ++++ b/helper.c 2025-01-10 17:17:24.801652374 +0400 +@@ -1,7 +1,9 @@ + /* + * helper functions for scponly + */ ++#define _DEFAULT_SOURCE /* for strsep */ + #include /* io */ ++#include /* for bzero */ + #include /* for str* */ + #include /* for stat, getpwuid */ + #include /* for stat */ +diff -ru a/scponly.c b/scponly.c +--- a/scponly.c 2025-01-10 17:16:03.332900358 +0400 ++++ b/scponly.c 2025-01-10 17:18:13.274524840 +0400 +@@ -6,7 +6,8 @@ + * + * see CONTRIB for additional credits + */ +- ++ ++#define _DEFAULT_SOURCE /* for seteuid */ + #include /* io */ + #include /* for str* */ + #include /* for fork, wait, stat */ diff --git a/net-misc/scponly/metadata.xml b/net-misc/scponly/metadata.xml index 3beb7f62de5b..995af96bb41e 100644 --- a/net-misc/scponly/metadata.xml +++ b/net-misc/scponly/metadata.xml @@ -32,5 +32,6 @@ scponly + scponly/scponly diff --git a/net-misc/scponly/scponly-4.8-r8.ebuild b/net-misc/scponly/scponly-4.8-r8.ebuild deleted file mode 100644 index 93ddd8138d29..000000000000 --- a/net-misc/scponly/scponly-4.8-r8.ebuild +++ /dev/null @@ -1,245 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit readme.gentoo-r1 toolchain-funcs - -DESCRIPTION="A tiny pseudoshell which only permits scp and sftp" -HOMEPAGE="https://github.com/scponly/scponly" -SRC_URI="https://downloads.sourceforge.net/scponly/${P}.tgz" - -LICENSE="BSD-2" -SLOT="0" -KEYWORDS="amd64 ~ppc sparc x86" -IUSE="chroot +sftp scp winscp gftp rsync unison subversion wildcards quota passwd logging" -REQUIRED_USE=" - || ( sftp scp winscp rsync unison subversion ) -" - -RDEPEND=" - sys-apps/sed - virtual/openssh - chroot? ( acct-user/scponly acct-group/scponly ) - quota? ( sys-fs/quota ) - rsync? ( net-misc/rsync ) - subversion? ( dev-vcs/subversion ) - unison? ( net-misc/unison:= ) -" -DEPEND="${RDEPEND}" - -PATCHES=( - "${FILESDIR}/${P}-rsync.patch" - "${FILESDIR}/${P}-gcc4.4.0.patch" - "${FILESDIR}/${P}-sftp-server-path.patch" -) - -src_configure() { - CFLAGS="${CFLAGS} ${LDFLAGS}" econf \ - --with-sftp-server="/usr/$(get_libdir)/misc/sftp-server" \ - --disable-restrictive-names \ - $(use_enable chroot chrooted-binary) \ - $(use_enable chroot chrooted-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) -} - -src_compile() { - emake CC="$(tc-getCC)" -} - -src_install() { - emake DESTDIR="${D}" install - - dodoc AUTHOR BUILDING-JAILS.TXT CHANGELOG CONTRIB README SECURITY TODO - - if use chroot ; then - local DOC_CONTENTS="You might want to run\n - emerge --config =${CATEGORY}/${PF}\n - \nto setup the chroot. Otherwise you will have to setup chroot - manually. Please read the docs in /usr/share/doc/${PF} for more - informations, also the SECURITY file." - ( docinto chroot; dodoc setup_chroot.sh config.h ) - # don't compress setup-script, so it is usable if necessary - docompress -x /usr/share/doc/${PF}/chroot - readme.gentoo_create_doc - fi -} - -pkg_config() { - if ! use chroot ; then - einfo "USE=chroot not enabled, nothing to configure." - return - fi - - myuser="scponly" - myhome="/var/chroot/${myuser}" - mysubdir="/pub" - - # pkg_postinst is based on ${S}/setup_chroot.sh. - - einfo "Collecting binaries and libraries..." - - # Binaries launched in sftp compat mode - if has_version "=${CATEGORY}/${PF}[sftp]" ; then - BINARIES="/usr/$(get_libdir)/misc/sftp-server" - fi - - # Binaries launched by vanilla- and WinSCP modes - if has_version "=${CATEGORY}/${PF}[scp]" || \ - has_version "=${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 has_version "=${CATEGORY}/${PF}[winscp]" ; then - BINARIES="${BINARIES} /bin/pwd /bin/groups /usr/bin/id /bin/echo" - fi - - # Rsync compatability mode - if has_version "=${CATEGORY}/${PF}[rsync]" ; then - BINARIES="${BINARIES} /usr/bin/rsync" - fi - - # Unison compatability mode - if has_version "=${CATEGORY}/${PF}[unison]" ; then - BINARIES="${BINARIES} /usr/bin/unison" - fi - - # subversion cli/svnserv compatibility - if has_version "=${CATEGORY}/${PF}[subversion]" ; then - BINARIES="${BINARIES} /usr/bin/svn /usr/bin/svnserve" - fi - - # passwd compatibility - if has_version "=${CATEGORY}/${PF}[passwd]" ; then - BINARIES="${BINARIES} /usr/bin/passwd" - fi - - # quota compatibility - if has_version "=${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 - die "Home '${myhome}' should have been created by acct-user but does not exist." - else - einfo "Setting owner for ${myhome}" - chown 0:0 "${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}" = "/usr/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 -} diff --git a/net-misc/scponly/scponly-4.8-r9.ebuild b/net-misc/scponly/scponly-4.8-r9.ebuild new file mode 100644 index 000000000000..2d6d02714439 --- /dev/null +++ b/net-misc/scponly/scponly-4.8-r9.ebuild @@ -0,0 +1,252 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit readme.gentoo-r1 toolchain-funcs autotools + +DESCRIPTION="A tiny pseudoshell which only permits scp and sftp" +HOMEPAGE="https://github.com/scponly/scponly" +SRC_URI="https://downloads.sourceforge.net/scponly/${P}.tgz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="amd64 ~ppc sparc x86" +IUSE="chroot +sftp scp winscp gftp rsync unison subversion wildcards quota passwd logging" +REQUIRED_USE=" + || ( sftp scp winscp rsync unison subversion ) +" + +RDEPEND=" + sys-apps/sed + virtual/openssh + chroot? ( acct-user/scponly acct-group/scponly ) + quota? ( sys-fs/quota ) + rsync? ( net-misc/rsync ) + subversion? ( dev-vcs/subversion ) + unison? ( net-misc/unison:= ) +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-rsync.patch" + "${FILESDIR}/${P}-gcc4.4.0.patch" + "${FILESDIR}/${P}-sftp-server-path.patch" + "${FILESDIR}/${P}-C23.patch" +) + +src_prepare() { + default + + # bug #900316 + eautoreconf +} + +src_configure() { + CFLAGS="${CFLAGS} ${LDFLAGS}" econf \ + --disable-restrictive-names \ + $(use_enable chroot chrooted-binary) \ + $(use_enable chroot chroot-checkdir) \ + $(use_enable winscp winscp-compat) \ + $(use_enable gftp gftp-compat) \ + $(use_enable scp scp-compat) \ + $(use_with sftp sftp-server "/usr/$(get_libdir)/misc/sftp-server") \ + $(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) +} + +src_compile() { + emake CC="$(tc-getCC)" +} + +src_install() { + emake DESTDIR="${D}" install + + dodoc AUTHOR BUILDING-JAILS.TXT CHANGELOG CONTRIB README SECURITY TODO + + if use chroot ; then + local DOC_CONTENTS="You might want to run\n + emerge --config =${CATEGORY}/${PF}\n + \nto setup the chroot. Otherwise you will have to setup chroot + manually. Please read the docs in /usr/share/doc/${PF} for more + informations, also the SECURITY file." + ( docinto chroot; dodoc setup_chroot.sh config.h ) + # don't compress setup-script, so it is usable if necessary + docompress -x /usr/share/doc/${PF}/chroot + readme.gentoo_create_doc + fi +} + +pkg_config() { + if ! use chroot ; then + einfo "USE=chroot not enabled, nothing to configure." + return + fi + + myuser="scponly" + myhome="/var/chroot/${myuser}" + mysubdir="/pub" + + # pkg_postinst is based on ${S}/setup_chroot.sh. + + einfo "Collecting binaries and libraries..." + + # Binaries launched in sftp compat mode + if has_version "=${CATEGORY}/${PF}[sftp]" ; then + BINARIES="/usr/$(get_libdir)/misc/sftp-server" + fi + + # Binaries launched by vanilla- and WinSCP modes + if has_version "=${CATEGORY}/${PF}[scp]" || \ + has_version "=${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 has_version "=${CATEGORY}/${PF}[winscp]" ; then + BINARIES="${BINARIES} /bin/pwd /bin/groups /usr/bin/id /bin/echo" + fi + + # Rsync compatability mode + if has_version "=${CATEGORY}/${PF}[rsync]" ; then + BINARIES="${BINARIES} /usr/bin/rsync" + fi + + # Unison compatability mode + if has_version "=${CATEGORY}/${PF}[unison]" ; then + BINARIES="${BINARIES} /usr/bin/unison" + fi + + # subversion cli/svnserv compatibility + if has_version "=${CATEGORY}/${PF}[subversion]" ; then + BINARIES="${BINARIES} /usr/bin/svn /usr/bin/svnserve" + fi + + # passwd compatibility + if has_version "=${CATEGORY}/${PF}[passwd]" ; then + BINARIES="${BINARIES} /usr/bin/passwd" + fi + + # quota compatibility + if has_version "=${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 + die "Home '${myhome}' should have been created by acct-user but does not exist." + else + einfo "Setting owner for ${myhome}" + chown 0:0 "${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}" = "/usr/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 +} -- cgit v1.2.3