shells/scponly: Remove port

Unmaintained upstream as last release was in 2011
This commit is contained in:
2025-04-27 20:32:20 +02:00
parent f28b6955d7
commit 1ecb148e2e
8 changed files with 1 additions and 215 deletions
-1
View File
@@ -49,7 +49,6 @@
SUBDIR += rush
SUBDIR += sash
SUBDIR += schemesh
SUBDIR += scponly
SUBDIR += sheldon
SUBDIR += shell-hist
SUBDIR += shellharden
-81
View File
@@ -1,81 +0,0 @@
PORTNAME= scponly
PORTVERSION= 4.8.20110526
PORTREVISION= 8
CATEGORIES= shells security
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-snapshots
DISTNAME= ${PORTNAME}-20110526
MAINTAINER= garga@FreeBSD.org
COMMENT= Tiny shell that only permits scp and sftp
WWW= https://github.com/scponly/scponly/wiki
LICENSE= BSD2CLAUSE
USES= cpe tar:tgz
PORTDOCS= BUILDING-JAILS.TXT INSTALL README SECURITY
GNU_CONFIGURE= yes
GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
OPTIONS_DEFINE= CHROOT DEFAULT_CHDIR DOCS GFTP RSYNC SCP SUBVERSION SVNSERVE \
UNISON WILDCARDS WINSCP
OPTIONS_DEFAULT= WILDCARDS
DEFAULT_CHDIR_DESC= Chdir(2) by default
WILDCARDS_DESC= Wildcards processing
GFTP_DESC= gftp support
RSYNC_DESC= rsync support
CHROOT_DESC= chroot(8) functionality
SCP_DESC= vanilla scp support
SVNSERVE_DESC= Subversion support for svn+ssh://
UNISON_DESC= Unisson support
WINSCP_DESC= WinSCP support
OPTIONS_SUB= yes
.if !exists(/usr/bin/sftp)
BUILD_DEPENDS+= openssh-portable>0:security/openssh-portable
RUN_DEPENDS+= openssh-portable>0:security/openssh-portable
.endif
DEFAULT_CHDIR_CONFIGURE_ON= --with-default-chdir=${SCPONLY_DEFAULT_CHDIR}
WILDCARDS_CONFIGURE_ENABLE= wildcards
GFTP_CONFIGURE_ENABLE= gftp-compat
CHROOT_CONFIGURE_ENABLE= chrooted-binary
CHROOT_USE= RC_SUBR=scponlyc
RSYNC_BUILD_DEPENDS= rsync:net/rsync
RSYNC_RUN_DEPENDS= rsync:net/rsync
RSYNC_CONFIGURE_ENABLE= rsync-compat
SCP_CONFIGURE_ENABLE= scp-compat
SUBVERSION_CONFIGURE_ENABLE= svn-compat
.if ${WITH_SUBVERSION_VER:U} == LTS
SUBVERSION_BUILD_DEPENDS= svn:devel/subversion-lts
SUBVERSION_RUN_DEPENDS= svn:devel/subversion-lts
SVNSERVE_BUILD_DEPENDS= svn:devel/subversion-lts
SVNSERVE_RUN_DEPENDS= svn:devel/subversion-lts
.else
SUBVERSION_BUILD_DEPENDS= svn:devel/subversion
SUBVERSION_RUN_DEPENDS= svn:devel/subversion
SVNSERVE_BUILD_DEPENDS= svn:devel/subversion
SVNSERVE_RUN_DEPENDS= svn:devel/subversion
.endif
SVNSERVE_CONFIGURE_ENABLE= svnserv-compat
UNISON_BUILD_DEPENDS= unison:net/unison
UNISON_RUN_DEPENDS= unison:net/unison
UNISON_CONFIGURE_ENABLE= unison-compat
WINSCP_CONFIGURE_ENABLE= winscp-compat
post-patch:
@${ECHO_MSG} "In addition to knobs available from the OPTIONS dialog,"
@${ECHO_MSG} "you may set SCPONLY_DEFAULT_CHDIR to make users 'cd' to"
@${ECHO_MSG} "this directory after authentication."
@${REINPLACE_CMD} -e "s/-o 0 -g 0//g" ${WRKSRC}/Makefile.in
post-install:
@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_SCRIPT} ${WRKSRC}/setup_chroot.sh ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/config.h ${STAGEDIR}${EXAMPLESDIR}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
.for i in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/$i ${STAGEDIR}${DOCSDIR}
.endfor
.include <bsd.port.mk>
-2
View File
@@ -1,2 +0,0 @@
SHA256 (scponly-20110526.tgz) = 46aac15a277a86ae43add03b4480150ac65830c7f0ef683532d383ba93dd7b03
SIZE (scponly-20110526.tgz) = 116147
-27
View File
@@ -1,27 +0,0 @@
--- helper.c.orig 2010-09-08 05:58:11 UTC
+++ helper.c
@@ -323,16 +323,22 @@ int valid_arg_vector(char **av)
char *substitute_known_path(char *request)
{
cmd_t *cmd=commands;
- char *stripped_req=strdup(basename(request));
+ char *mrequest=strdup(request);
+ char *stripped_req=strdup(basename(mrequest));
+ free(mrequest);
while (cmd != NULL)
{
+ char *mname;
if (cmd->name == NULL)
break;
- if (exact_match(basename(cmd->name),stripped_req))
+ mname = strdup(cmd->name);
+ if (exact_match(basename(mname),stripped_req))
{
free(stripped_req); /* discard old pathname */
+ free(mname);
return (strdup(cmd->name));
}
+ free(mname);
cmd++;
}
return (stripped_req);
-79
View File
@@ -1,79 +0,0 @@
#!/bin/sh
# PROVIDE: scponlyc
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable scponly:
# scponlyc_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable scponly
# scponlyc_shells (str): Set to "/etc/shells" by default.
# scponlyc_passwd (str): Set to "/etc/passwd" by default.
. /etc/rc.subr
scponlyc_shells="${scponlyc_shells:-/etc/shells}"
scponlyc_passwd="${scponlyc_passwd:-/etc/passwd}"
name="scponlyc"
rcvar=scponlyc_enable
start_cmd="scponlyc_startcmd"
stop_cmd="scponlyc_stopcmd"
required_files="$scponlyc_shells $scponlyc_passwd"
scponlyc=%%PREFIX%%/sbin/scponlyc
make_devfs() {
# $1 is the user name whose home directory needs a minimal
# devfs created. If ~/dev exists, it will be deleted.
eval DEV="~$1/dev"
if /sbin/mount | grep "${DEV}" >/dev/null 2>&1; then
/sbin/umount "${DEV}" 2>/dev/null
fi
/bin/rmdir "${DEV}" || err 1 "Unable to remove $DEV"
/bin/mkdir -p "${DEV}"
devfs_domount "${DEV}"
if devfs_init_rulesets; then
devfs_apply_ruleset "devfsrules_hide_all" "${DEV}" && \
devfs_apply_ruleset "devfsrules_unhide_basic" "${DEV}" || \
/sbin/umount "${DEV}" 2>/dev/null
fi
}
users_configured() {
if [ `/usr/bin/grep -c "/scponlyc$" ${scponlyc_shells} 2>/dev/null` -ne 1 ]; then
exit 1
fi
}
scponlyc_startcmd() {
users_configured
/usr/bin/grep "^[^#]*:.*:.*:.*:.*:.*:${scponlyc}$" ${scponlyc_passwd} |
/usr/bin/awk -F: {'print $1'} |
while read USER; do
/bin/echo "${USER}/dev"
make_devfs "${USER}"
done
}
scponlyc_stopcmd() {
users_configured
/usr/bin/grep "^[^#]*:.*:.*:.*:.*:.*:${scponlyc}$" ${scponlyc_passwd} |
/usr/bin/awk -F: {'print $1'} |
while read USER; do
/bin/echo "${USER}/dev"
eval DEV="~${USER}/dev"
/sbin/umount ${DEV} 2>/dev/null
done
}
load_rc_config $name
run_rc_command "$1"
-10
View File
@@ -1,10 +0,0 @@
[Excerpted from the README:] "scponly" is an alternative "shell" (of sorts)
for system administrators who would like to provide access to remote users to
both read and write local files without providing any remote execution
privileges. Functionally, it is best described as a wrapper to the
tried-and-true ssh suite.
scponly validates remote requests by examining the third argument passed to the
shell upon login. (The first argument is the shell itself, and the second is
-c.) The only commands allowed are "scp", "sftp-server" and "ls". Arguments
to these commands are passed along unmolested.
-15
View File
@@ -1,15 +0,0 @@
@shell bin/scponly
%%CHROOT%%@exec echo ""
%%CHROOT%%@exec echo "To setup chroot cage, run the following commands:"
%%CHROOT%%@exec echo " 1) cd %%PREFIX%%/%%EXAMPLESDIR%%/ && /bin/sh setup_chroot.sh"
%%CHROOT%%@exec echo " 2) Set scponlyc_enable=\"YES\" in /etc/rc.conf"
%%CHROOT%%@exec echo " 3) Run %%PREFIX%%/etc/rc.d/scponly start"
%%PORTDOCS%%@exec echo ""
%%PORTDOCS%%@exec echo "For information on several potential security concerns,"
%%PORTDOCS%%@exec echo "please read:"
%%PORTDOCS%%@exec echo "%%PREFIX%%/%%DOCSDIR%%/SECURITY"
%%CHROOT%%@shell sbin/scponlyc
%%CHROOT%%%%EXAMPLESDIR%%/setup_chroot.sh
%%CHROOT%%%%EXAMPLESDIR%%/config.h
etc/scponly/debuglevel
share/man/man8/scponly.8.gz