diff options
author | dinoex <dinoex@FreeBSD.org> | 2010-08-07 15:49:17 +0800 |
---|---|---|
committer | dinoex <dinoex@FreeBSD.org> | 2010-08-07 15:49:17 +0800 |
commit | 1c37717372d7d98a258335b55427139ef2993a9b (patch) | |
tree | c6bd3f127f30d165ad9b66dd0757935c7f15928d /ftp/vsftpd | |
parent | 6fe8d10844fdf146972eda6de187c893e099a07d (diff) | |
download | freebsd-ports-gnome-1c37717372d7d98a258335b55427139ef2993a9b.tar.gz freebsd-ports-gnome-1c37717372d7d98a258335b55427139ef2993a9b.tar.zst freebsd-ports-gnome-1c37717372d7d98a258335b55427139ef2993a9b.zip |
- rc.d supports now vsftpd_config
PR: 146556
- new option WITH_PIDFILE
Submitted by: Eugen Zagorodniy
- update to 2.3.0
Diffstat (limited to 'ftp/vsftpd')
-rw-r--r-- | ftp/vsftpd/Makefile | 9 | ||||
-rw-r--r-- | ftp/vsftpd/distinfo | 6 | ||||
-rw-r--r-- | ftp/vsftpd/files/pidfile.patch | 87 | ||||
-rw-r--r-- | ftp/vsftpd/files/vsftpd.sh.in | 12 |
4 files changed, 104 insertions, 10 deletions
diff --git a/ftp/vsftpd/Makefile b/ftp/vsftpd/Makefile index 4681b8017eb7..5b54758018e5 100644 --- a/ftp/vsftpd/Makefile +++ b/ftp/vsftpd/Makefile @@ -6,7 +6,7 @@ # PORTNAME= vsftpd -PORTVERSION= 2.2.2 +PORTVERSION= 2.3.0 CATEGORIES= ftp ipv6 MASTER_SITES= ftp://vsftpd.beasts.org/users/cevans/ PKGNAMESUFFIX?= ${SSL_SUFFIX}${PKGNAMESUFFIX2} @@ -26,7 +26,8 @@ DOCFILES= AUDIT BENCHMARKS BUGS Changelog FAQ INSTALL LICENSE \ LDFLAGS+= -lwrap OPTIONS= RC_NG "install RC_NG script" off \ - VSFTPD_SSL "Include support for SSL" off + VSFTPD_SSL "Include support for SSL" off \ + PIDFILE "unofficial support for pidfile" off .include <bsd.port.pre.mk> @@ -46,6 +47,10 @@ LDFLAGS+= -L${OPENSSLLIB} MAKE_ENV+= LDFLAGS="${LDFLAGS}" .endif +.if defined(WITH_PIDFILE) +EXTRA_PATCHES+= ${FILESDIR}/pidfile.patch +.endif + do-configure: ${REINPLACE_CMD} -e "s|/etc/vsftpd.conf|${PREFIX}/etc/vsftpd.conf|" \ ${WRKSRC}/defs.h ${WRKSRC}/vsftpd.conf diff --git a/ftp/vsftpd/distinfo b/ftp/vsftpd/distinfo index 882d5a8fc945..6dc23a4dff4f 100644 --- a/ftp/vsftpd/distinfo +++ b/ftp/vsftpd/distinfo @@ -1,3 +1,3 @@ -MD5 (vsftpd-2.2.2.tar.gz) = 6d6bc136af14c23f8fef6f1a51f55418 -SHA256 (vsftpd-2.2.2.tar.gz) = 05665dfa43a268e6fe422b89f6c3cb1a63e4e989b456922508f3f89d4b276eab -SIZE (vsftpd-2.2.2.tar.gz) = 185562 +MD5 (vsftpd-2.3.0.tar.gz) = 90ea878fcfba32f764cce4dc264a3d68 +SHA256 (vsftpd-2.3.0.tar.gz) = f4e17fd1bf550b5be37941611ff81fff71e18fdc99a9f82af6bcd95ae204caf5 +SIZE (vsftpd-2.3.0.tar.gz) = 187122 diff --git a/ftp/vsftpd/files/pidfile.patch b/ftp/vsftpd/files/pidfile.patch new file mode 100644 index 000000000000..da420ccf9c43 --- /dev/null +++ b/ftp/vsftpd/files/pidfile.patch @@ -0,0 +1,87 @@ +diff -ruN ../vsftpd-2.0.7.orig/parseconf.c ./parseconf.c +--- ../vsftpd-2.0.7.orig/parseconf.c 2008-08-01 18:35:33.000000000 +0300 ++++ ./parseconf.c 2008-08-01 18:35:30.000000000 +0300 +@@ -149,6 +149,7 @@ + { "secure_chroot_dir", &tunable_secure_chroot_dir }, + { "ftp_username", &tunable_ftp_username }, + { "chown_username", &tunable_chown_username }, ++ { "pid_file", &tunable_pid_file }, + { "xferlog_file", &tunable_xferlog_file }, + { "vsftpd_log_file", &tunable_vsftpd_log_file }, + { "message_file", &tunable_message_file }, +diff -ruN ../vsftpd-2.0.7.orig/standalone.c ./standalone.c +--- ../vsftpd-2.0.7.orig/standalone.c 2008-08-01 18:35:34.000000000 +0300 ++++ ./standalone.c 2008-08-01 18:46:36.000000000 +0300 +@@ -7,6 +7,8 @@ + * Code to listen on the network and launch children servants. + */ + ++#include <stdio.h> ++ + #include "standalone.h" + + #include "parseconf.h" +@@ -49,7 +51,23 @@ + int forkret = vsf_sysutil_fork(); + if (forkret > 0) + { +- /* Parent, just exit */ ++ /* Parent, write pidfile (if nessesary) and exit. */ ++ if (tunable_pid_file) ++ { ++ FILE* pidfile = fopen(tunable_pid_file, "w"); ++ if (NULL != pidfile) ++ { ++ if (0 > fprintf(pidfile, "%d\n", forkret)) ++ { ++ die2("failed write to pidfile:", tunable_pid_file); ++ } ++ fclose(pidfile); ++ } ++ else ++ { ++ die2("cannot open pidfile:", tunable_pid_file); ++ } ++ } + vsf_sysutil_exit(0); + } + /* Son, close standard FDs to avoid SSH hang-on-exit */ +diff -ruN ../vsftpd-2.0.7.orig/tunables.c ./tunables.c +--- ../vsftpd-2.0.7.orig/tunables.c 2008-08-01 18:35:33.000000000 +0300 ++++ ./tunables.c 2008-08-01 18:55:17.000000000 +0300 +@@ -107,6 +107,7 @@ + const char* tunable_secure_chroot_dir; + const char* tunable_ftp_username; + const char* tunable_chown_username; ++const char* tunable_pid_file = 0; + const char* tunable_xferlog_file; + const char* tunable_vsftpd_log_file; + const char* tunable_message_file; +diff -ruN ../vsftpd-2.0.7.orig/tunables.h ./tunables.h +--- ../vsftpd-2.0.7.orig/tunables.h 2008-08-01 18:35:34.000000000 +0300 ++++ ./tunables.h 2008-08-01 18:35:31.000000000 +0300 +@@ -101,6 +101,7 @@ + extern const char* tunable_secure_chroot_dir; + extern const char* tunable_ftp_username; + extern const char* tunable_chown_username; ++extern const char* tunable_pid_file; + extern const char* tunable_xferlog_file; + extern const char* tunable_vsftpd_log_file; + extern const char* tunable_message_file; +diff -ruN ../vsftpd-2.0.7.orig/vsftpd.conf.5 ./vsftpd.conf.5 +--- ../vsftpd-2.0.7.orig/vsftpd.conf.5 2008-08-01 18:35:34.000000000 +0300 ++++ ./vsftpd.conf.5 2008-08-01 18:35:31.000000000 +0300 +@@ -923,6 +923,13 @@ + + Default: (none - the address is taken from the incoming connected socket) + .TP ++.B pid_file ++This option has efect only if ++.BR background ++is set. It writes pid of running daemon to file at the specified path. ++ ++Default: (none) (no pidfile is created) ++.TP + .B rsa_cert_file + This option specifies the location of the RSA certificate to use for SSL + encrypted connections. diff --git a/ftp/vsftpd/files/vsftpd.sh.in b/ftp/vsftpd/files/vsftpd.sh.in index ece3a60d6c0d..6b26ed855ad1 100644 --- a/ftp/vsftpd/files/vsftpd.sh.in +++ b/ftp/vsftpd/files/vsftpd.sh.in @@ -10,7 +10,8 @@ # 1. add the following line(s) to /etc/rc.conf to enable `vsftpd': # # vsftpd_enable="YES" -# vsftpd_flags="/some/path/conf.file" # Not required +# vsftpd_flags="-ooption=value" # Not required +# vsftpd_config="/some/path/conf.file" # Not required # # 2. tell vsftpd about standalone mode # Edit %%PREFIX%%/etc/vsftpd.conf (or /some/path/conf.file) to contain @@ -27,23 +28,24 @@ rcvar=`set_rcvar` load_rc_config "$name" : ${vsftpd_enable:="NO"} +: ${vsftpd_config:="%%PREFIX%%/etc/$name.conf"} command="%%PREFIX%%/libexec/$name" -required_files="%%PREFIX%%/etc/$name.conf" +required_files="${vsftpd_config}" start_precmd="vsftpd_check" extra_commands="reload" vsftpd_check() { - if grep -q "^ftp[ ]" /etc/inetd.conf ${required_files} + if grep -q "^ftp[ ]" /etc/inetd.conf then err 1 "ftp is already activated in /etc/inetd.conf" fi - if ! egrep -q -i -E "^listen.*=.*YES$" ${required_files} + if ! egrep -q -i -E "^listen.*=.*YES$" ${vsftpd_config} then err 1 'vsftpd script need "listen=YES" in config file' fi - if ! egrep -q -i -E "^background.*=.*YES$" ${required_files} + if ! egrep -q -i -E "^background.*=.*YES$" ${vsftpd_config} then err 1 'vsftpd script need "background=YES" in config file' fi |