Index: head/shells/scponly/Makefile =================================================================== --- head/shells/scponly/Makefile (revision 495578) +++ head/shells/scponly/Makefile (revision 495579) @@ -1,72 +1,75 @@ # Created by: mcglk@artlogix.com # $FreeBSD$ PORTNAME= scponly PORTVERSION= 4.8.20110526 -PORTREVISION= 3 +PORTREVISION= 4 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 LICENSE= BSD2CLAUSE -PORTDOCS= BUILDING-JAILS.TXT INSTALL README SECURITY - USES= tar:tgz + +PORTDOCS= BUILDING-JAILS.TXT INSTALL README SECURITY GNU_CONFIGURE= yes OPTIONS_DEFINE= WILDCARDS GFTP CHROOT RSYNC SCP SVN SVNSERVE UNISON WINSCP \ DEFAULT_CHDIR DOCS 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= Suversion support for svn+ssh:// UNISON_DESC= Unisson support WINSCP_DESC= WinSCP support OPTIONS_SUB= yes .if !exists(/usr/bin/sftp) -BUILD_DEPENDS= ${LOCALBASE}/bin/sftp:security/openssh-portable +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 SVN_CONFIGURE_ENABLE= svn-compat SVN_BUILD_DEPENDS= svn:devel/subversion +SVN_RUN_DEPENDS= svn:devel/subversion SVNSERVE_BUILD_DEPENDS= svn:devel/subversion +SVNSERVE_RUN_DEPENDS= svn:devel/subversion 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 - -RUN_DEPENDS:= ${BUILD_DEPENDS} 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 Index: head/shells/scponly/files/patch-helper.c =================================================================== --- head/shells/scponly/files/patch-helper.c (revision 495578) +++ head/shells/scponly/files/patch-helper.c (revision 495579) @@ -1,26 +1,27 @@ --- helper.c.orig 2010-09-08 05:58:11 UTC +++ helper.c -@@ -323,16 +323,20 @@ int valid_arg_vector(char **av) +@@ -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 *stripped_req=strdup(request); -+ stripped_req=basename(stripped_req); ++ char *mrequest=strdup(request); ++ char *stripped_req=strdup(basename(mrequest)); ++ free(mrequest); while (cmd != NULL) { -+ char *nname; ++ char *mname; if (cmd->name == NULL) break; - if (exact_match(basename(cmd->name),stripped_req)) -+ nname = strdup(cmd->name); -+ if (exact_match(basename(nname),stripped_req)) ++ mname = strdup(cmd->name); ++ if (exact_match(basename(mname),stripped_req)) { free(stripped_req); /* discard old pathname */ -- return (strdup(cmd->name)); -+ return (nname); ++ free(mname); + return (strdup(cmd->name)); } -+ free(nname); ++ free(mname); cmd++; } return (stripped_req);