1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

- remove user ftp on deinstall

- remove deinstall/install scripts

- create /var/ftp in stage
PR:		185300
This commit is contained in:
Dirk Meyer 2013-12-31 07:41:01 +00:00
parent f88830c9a6
commit 4cc160ab2d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=338258
4 changed files with 6 additions and 58 deletions

View File

@ -56,7 +56,7 @@ VSFTPD_NO_SSP= -e "s|-fstack-protector --param=ssp-buffer-size=4 ||"
.endif
do-configure:
.if !defined(WITHOUT_SSL) && ${PORT_OPTIONS:MVSFTPD_SSL}
.if ${PORT_OPTIONS:MVSFTPD_SSL} && !defined(WITHOUT_SSL)
${REINPLACE_CMD} -e \
"s|#undef VSF_BUILD_TCPWRAPPERS|#define VSF_BUILD_TCPWRAPPERS 1|" \
-e "s|#undef VSF_BUILD_SSL|#define VSF_BUILD_SSL 1|" \
@ -86,14 +86,12 @@ do-configure:
@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# listen=YES"
@${ECHO_CMD} >>${WRKSRC}/vsftpd.conf "# background=YES"
pre-install:
${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/vsftpd ${STAGEDIR}${PREFIX}/libexec/
${INSTALL_DATA} ${WRKSRC}/vsftpd.conf ${STAGEDIR}${PREFIX}/etc/vsftpd.conf.dist
${INSTALL_MAN} ${WRKSRC}/vsftpd.conf.5 ${STAGEDIR}${MANPREFIX}/man/man5/
${INSTALL_MAN} ${WRKSRC}/vsftpd.8 ${STAGEDIR}${MANPREFIX}/man/man8/
${MKDIR} ${STAGEDIR}/var/ftp
.if ${PORT_OPTIONS:MDOCS}
${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} -m 644 ${DOCFILES:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}/

View File

@ -1,16 +0,0 @@
#!/bin/sh
# $FreeBSD$
#
if [ "$2" != "POST-DEINSTALL" ]; then
exit 0
fi
USER=ftp
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete FTP user permanently, use 'pw userdel ${USER}'"
echo "Don't do this if you're using FreeBSD's anonymous FTP server"
fi
exit 0

View File

@ -1,36 +0,0 @@
#!/bin/sh
# $FreeBSD$
#
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
if ! pw groupshow operator >/dev/null; then
if pw groupadd operator 5; then
echo "Added group operator for vsftpd"
else
echo "Failed to add group operator as gid 5" >&2
exit 1
fi
fi
if ! pw usershow ftp >/dev/null; then
if pw useradd ftp -g operator -u 14 -h - -d /var/ftp -s /nonexistent -c "Anonymous Ftp"; then
echo "Added user ftp for vsftpd"
else
echo "Failed to add user ftp as gid 14" >&2
exit 1
fi
fi
# uid=14(ftp) gid=5(operator) groups=5(operator)
view="$(id ftp)"
view="${view%% *}"
if test "${view}" = "uid=14(ftp)"; then
exit 0
fi
echo "User ftp should have uid 14"; >&2
exit 1
# eof

View File

@ -1,12 +1,14 @@
libexec/vsftpd
man/man5/vsftpd.conf.5.gz
man/man8/vsftpd.8.gz
@exec mkdir -p %D/share/vsftpd/empty
@exec if ! pw usershow ftp 2>/dev/null; then pw useradd ftp -g operator -u 14 -h - -d /var/ftp -s /nonexistent -c "Anonymous Ftp"; fi
@unexec if pw usershow ftp | grep -q 14:5; then pw userdel ftp; fi
@unexec if diff -q %D/etc/vsftpd.conf %D/etc/vsftpd.conf.dist; then rm %D/etc/vsftpd.conf; fi
etc/vsftpd.conf.dist
@exec if [ ! -f %B/vsftpd.conf ]; then cp %B/vsftpd.conf.dist %B/vsftpd.conf; fi
@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
@unexec rmdir /var/ftp 2>/dev/null || true
@exec if [ ! -d /var/ftp ]; then mkdir /var/ftp ; fi
@exec mkdir -p %D/share/vsftpd/empty
@dirrm share/vsftpd/empty
@dirrm share/vsftpd
%%PORTDOCS%%%%DOCSDIR%%/AUDIT