diff options
author | Andrew Savchenko <bircoph@gmail.com> | 2010-10-24 07:15:39 +0400 |
---|---|---|
committer | Andrew Savchenko <bircoph@gmail.com> | 2010-10-24 07:15:39 +0400 |
commit | 550680c6ad6a8988199c1e54c9559fe76dcd19b0 (patch) | |
tree | 7b7872d26c3acb0eed13b44f2a36a3aafef9dcd6 /net-ftp/vsftpd/files | |
parent | Add symlookup utility. (diff) | |
download | bircoph-550680c6ad6a8988199c1e54c9559fe76dcd19b0.tar.gz bircoph-550680c6ad6a8988199c1e54c9559fe76dcd19b0.tar.bz2 bircoph-550680c6ad6a8988199c1e54c9559fe76dcd19b0.zip |
Add vsftpd with unicode logs support.
Adds a patch for vsftpd to correctly display unicode filenames in
vsftpd logs.
Diffstat (limited to 'net-ftp/vsftpd/files')
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch | 15 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch | 21 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd-2.2.0-gentoo.patch | 264 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd-2.2.0-logging.patch | 12 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch | 13 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch | 20 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd.conf | 105 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd.init | 69 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd.logrotate | 4 | ||||
-rw-r--r-- | net-ftp/vsftpd/files/vsftpd.xinetd | 15 |
10 files changed, 538 insertions, 0 deletions
diff --git a/net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch b/net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch new file mode 100644 index 0000000..bd29762 --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd-2.1.0-caps.patch @@ -0,0 +1,15 @@ +diff -ur vsftpd-2.1.0.orig/sysdeputil.c vsftpd-2.1.0/sysdeputil.c +--- vsftpd-2.1.0.orig/sysdeputil.c 2009-02-23 18:23:26.000000000 +0100 ++++ vsftpd-2.1.0/sysdeputil.c 2009-02-23 18:23:51.000000000 +0100 +@@ -160,10 +160,8 @@ + #include <sys/capability.h> + + #if defined(VSF_SYSDEP_HAVE_CAPABILITIES) && !defined(VSF_SYSDEP_HAVE_LIBCAP) +-#include <linux/unistd.h> + #include <linux/capability.h> +-#include <errno.h> +-#include <syscall.h> ++#include <sys/syscall.h> + int capset(cap_user_header_t header, const cap_user_data_t data) + { + return syscall(__NR_capset, header, data); diff --git a/net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch b/net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch new file mode 100644 index 0000000..debcf06 --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd-2.2.0-dont-link-caps.patch @@ -0,0 +1,21 @@ +diff -ur vsftpd-2.2.0.orig/vsf_findlibs.sh vsftpd-2.2.0/vsf_findlibs.sh +--- vsftpd-2.2.0.orig/vsf_findlibs.sh 2009-08-23 22:15:39.000000000 -0700 ++++ vsftpd-2.2.0/vsf_findlibs.sh 2009-08-23 22:16:31.000000000 -0700 +@@ -44,17 +44,6 @@ + # For older HP-UX... + locate_library /usr/lib/libsec.sl && echo "-lsec"; + +-# Look for libcap (capabilities) +-if locate_library /lib/libcap.so.1; then +- echo "/lib/libcap.so.1"; +-elif locate_library /lib/libcap.so.2; then +- echo "/lib/libcap.so.2"; +-else +- locate_library /usr/lib/libcap.so && echo "-lcap"; +- locate_library /lib/libcap.so && echo "-lcap"; +- locate_library /lib64/libcap.so && echo "-lcap"; +-fi +- + # Solaris needs this for nanosleep().. + locate_library /lib/libposix4.so && echo "-lposix4"; + locate_library /usr/lib/libposix4.so && echo "-lposix4"; diff --git a/net-ftp/vsftpd/files/vsftpd-2.2.0-gentoo.patch b/net-ftp/vsftpd/files/vsftpd-2.2.0-gentoo.patch new file mode 100644 index 0000000..353dff3 --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd-2.2.0-gentoo.patch @@ -0,0 +1,264 @@ +diff -NrU5 vsftpd-2.2.0.original/defs.h vsftpd-2.2.0/defs.h +--- vsftpd-2.2.0.original/defs.h 2009-08-23 15:23:00.000000000 -0600 ++++ vsftpd-2.2.0/defs.h 2009-08-23 16:01:20.000000000 -0600 +@@ -1,9 +1,9 @@ + #ifndef VSF_DEFS_H + #define VSF_DEFS_H + +-#define VSFTP_DEFAULT_CONFIG "/etc/vsftpd.conf" ++#define VSFTP_DEFAULT_CONFIG "/etc/vsftpd/vsftpd.conf" + + #define VSFTP_COMMAND_FD 0 + + #define VSFTP_PASSWORD_MAX 128 + #define VSFTP_USERNAME_MAX 128 +diff -NrU5 vsftpd-2.2.0.original/tunables.c vsftpd-2.2.0/tunables.c +--- vsftpd-2.2.0.original/tunables.c 2009-08-23 15:23:00.000000000 -0600 ++++ vsftpd-2.2.0/tunables.c 2009-08-23 16:00:14.000000000 -0600 +@@ -244,23 +244,23 @@ + tunable_delay_successful_login = 0; + tunable_max_login_fails = 3; + /* -rw------- */ + tunable_chown_upload_mode = 0600; + +- install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir); ++ install_str_setting("/usr/share/vsftpd/empty", &tunable_secure_chroot_dir); + install_str_setting("ftp", &tunable_ftp_username); + install_str_setting("root", &tunable_chown_username); + install_str_setting("/var/log/xferlog", &tunable_xferlog_file); + install_str_setting("/var/log/vsftpd.log", &tunable_vsftpd_log_file); + install_str_setting(".message", &tunable_message_file); + install_str_setting("nobody", &tunable_nopriv_user); + install_str_setting(0, &tunable_ftpd_banner); +- install_str_setting("/etc/vsftpd.banned_emails", &tunable_banned_email_file); +- install_str_setting("/etc/vsftpd.chroot_list", &tunable_chroot_list_file); ++ install_str_setting("/etc/vsftpd/banned_emails", &tunable_banned_email_file); ++ install_str_setting("/etc/vsftpd/chroot_list", &tunable_chroot_list_file); + install_str_setting("ftp", &tunable_pam_service_name); + install_str_setting("ftp", &tunable_guest_username); +- install_str_setting("/etc/vsftpd.user_list", &tunable_userlist_file); ++ install_str_setting("/etc/vsftpd/user_list", &tunable_userlist_file); + install_str_setting(0, &tunable_anon_root); + install_str_setting(0, &tunable_local_root); + install_str_setting(0, &tunable_banner_file); + install_str_setting(0, &tunable_pasv_address); + install_str_setting(0, &tunable_listen_address); +@@ -269,11 +269,11 @@ + install_str_setting(0, &tunable_cmds_allowed); + install_str_setting(0, &tunable_cmds_denied); + install_str_setting(0, &tunable_hide_file); + install_str_setting(0, &tunable_deny_file); + install_str_setting(0, &tunable_user_sub_token); +- install_str_setting("/etc/vsftpd.email_passwords", ++ install_str_setting("/etc/vsftpd/email_passwords", + &tunable_email_password_file); + install_str_setting("/usr/share/ssl/certs/vsftpd.pem", + &tunable_rsa_cert_file); + install_str_setting(0, &tunable_dsa_cert_file); + install_str_setting("DES-CBC3-SHA", &tunable_ssl_ciphers); +diff -NrU5 vsftpd-2.2.0.original/vsftpd.8 vsftpd-2.2.0/vsftpd.8 +--- vsftpd-2.2.0.original/vsftpd.8 2009-08-23 15:23:00.000000000 -0600 ++++ vsftpd-2.2.0/vsftpd.8 2009-08-23 16:10:03.000000000 -0600 +@@ -19,11 +19,11 @@ + Alternatively, vsftpd can be launched in standalone mode, in which case vsftpd + itself will listen on the network. This latter mode is easier to use, and + recommended. It is activated by setting + .Pa listen=YES + in +-.Pa /etc/vsftpd.conf . ++.Pa /etc/vsftpd/vsftpd.conf . + Direct execution of the + .Nm vsftpd + binary will then launch the FTP service ready for immediate client connections. + .Sh OPTIONS + An optional +@@ -31,11 +31,11 @@ + may be given on the command line. These files must be owned as root if running + as root. Any command line option not starting with a "-" character is treated + as a config file that will be loaded. Note that config files are loaded in the + strict order that they are encountered on the command line. + If no config files are specified, the default configuration file of +-.Pa /etc/vsftpd.conf ++.Pa /etc/vsftpd/vsftpd.conf + will be loaded, after all other command line options are processed. + .Pp + Supported options are: + .Bl -tag -width Ds + .It Fl v +@@ -45,16 +45,16 @@ + -o options are supported, and they are applied in strict order relative to + their appearance on the command line, including intermingling with loading of + config files. + .El + .Sh EXAMPLES +-vsftpd -olisten=NO /etc/vsftpd.conf -oftpd_banner=blah ++vsftpd -olisten=NO /etc/vsftpd/vsftpd.conf -oftpd_banner=blah + .Pp + That example overrides vsftpd's built-in default for the "listen" option to be +-NO, but then loads /etc/vsftpd.conf which may override that setting. Finally, ++NO, but then loads /etc/vsftpd/vsftpd.conf which may override that setting. Finally, + the "ftpd_banner" setting is set to "blah", which overrides any default vsftpd + setting and any identical setting that was in the config file. + .Sh FILES +-.Pa /etc/vsftpd.conf ++.Pa /etc/vsftpd/vsftpd.conf + .Sh SEE ALSO + .Xr vsftpd.conf 5 + .end +diff -NrU5 vsftpd-2.2.0.original/vsftpd.conf vsftpd-2.2.0/vsftpd.conf +--- vsftpd-2.2.0.original/vsftpd.conf 2009-08-23 15:23:00.000000000 -0600 ++++ vsftpd-2.2.0/vsftpd.conf 2009-08-23 15:35:03.000000000 -0600 +@@ -1,6 +1,6 @@ +-# Example config file /etc/vsftpd.conf ++# Example config file /etc/vsftpd/vsftpd.conf + # + # The default compiled in settings are fairly paranoid. This sample file + # loosens things up a bit, to make the ftp daemon more usable. + # Please see vsftpd.conf.5 for all compiled in defaults. + # +@@ -85,19 +85,19 @@ + # + # You may specify a file of disallowed anonymous e-mail addresses. Apparently + # useful for combatting certain DoS attacks. + #deny_email_enable=YES + # (default follows) +-#banned_email_file=/etc/vsftpd.banned_emails ++#banned_email_file=/etc/vsftpd/banned_emails + # + # You may specify an explicit list of local users to chroot() to their home + # directory. If chroot_local_user is YES, then this list becomes a list of + # users to NOT chroot(). + #chroot_local_user=YES + #chroot_list_enable=YES + # (default follows) +-#chroot_list_file=/etc/vsftpd.chroot_list ++#chroot_list_file=/etc/vsftpd/chroot_list + # + # You may activate the "-R" option to the builtin ls. This is disabled by + # default to avoid remote users being able to cause excessive I/O on large + # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume + # the presence of the "-R" option, so there is a strong case for enabling it. +diff -NrU5 vsftpd-2.2.0.original/vsftpd.conf.5 vsftpd-2.2.0/vsftpd.conf.5 +--- vsftpd-2.2.0.original/vsftpd.conf.5 2009-08-23 15:23:00.000000000 -0600 ++++ vsftpd-2.2.0/vsftpd.conf.5 2009-08-23 15:49:59.000000000 -0600 +@@ -2,11 +2,11 @@ + .SH NAME + vsftpd.conf \- config file for vsftpd + .SH DESCRIPTION + vsftpd.conf may be used to control various aspects of vsftpd's behaviour. By + default, vsftpd looks for this file at the location +-.BR /etc/vsftpd.conf . ++.BR /etc/vsftpd/vsftpd.conf . + However, you may override this by specifying a command line argument to + vsftpd. The command line argument is the pathname of the configuration file + for vsftpd. This behaviour is useful because you may wish to use an advanced + inetd such as + .BR xinetd +@@ -136,11 +136,11 @@ + If activated, you may provide a list of local users who are placed in a + chroot() jail in their home directory upon login. The meaning is slightly + different if chroot_local_user is set to YES. In this case, the list becomes + a list of users which are NOT to be placed in a chroot() jail. + By default, the file containing this list is +-/etc/vsftpd.chroot_list, but you may override this with the ++/etc/vsftpd/chroot_list, but you may override this with the + .BR chroot_list_file + setting. + + Default: NO + .TP +@@ -175,11 +175,11 @@ + Default: NO + .TP + .B deny_email_enable + If activated, you may provide a list of anonymous password e-mail responses + which cause login to be denied. By default, the file containing this list is +-/etc/vsftpd.banned_emails, but you may override this with the ++/etc/vsftpd/banned_emails, but you may override this with the + .BR banned_email_file + setting. + + Default: NO + .TP +@@ -431,11 +431,11 @@ + access to low-security content without needing virtual users. When enabled, + anonymous logins are prevented unless the password provided is listed in the + file specified by the + .BR email_password_file + setting. The file format is one password per line, no extra whitespace. The +-default filename is /etc/vsftpd.email_passwords. ++default filename is /etc/vsftpd/email_passwords. + + Default: NO + .TP + .B session_support + This controls whether vsftpd attempts to maintain sessions for logins. If +@@ -762,11 +762,11 @@ + This option is the name of a file containing a list of anonymous e-mail + passwords which are not permitted. This file is consulted if the option + .BR deny_email_enable + is enabled. + +-Default: /etc/vsftpd.banned_emails ++Default: /etc/vsftpd/banned_emails + .TP + .B banner_file + This option is the name of a file containing text to display when someone + connects to the server. If set, it overrides the banner string provided by + the +@@ -799,11 +799,11 @@ + is enabled. If the option + .BR chroot_local_user + is enabled, then the list file becomes a list of users to NOT place in a + chroot() jail. + +-Default: /etc/vsftpd.chroot_list ++Default: /etc/vsftpd/chroot_list + .TP + .B cmds_allowed + This options specifies a comma separated list of allowed FTP commands (post + login. USER, PASS and QUIT and others are always allowed pre-login). Other + commands are rejected. This is a powerful method of really locking down an +@@ -860,11 +860,11 @@ + .B email_password_file + This option can be used to provide an alternate file for usage by the + .BR secure_email_list_enable + setting. + +-Default: /etc/vsftpd.email_passwords ++Default: /etc/vsftpd/email_passwords + .TP + .B ftp_username + This is the name of the user we use for handling anonymous FTP. The home + directory of this user is the root of the anonymous FTP area. + +@@ -983,14 +983,14 @@ + This powerful option allows the override of any config option specified in + the manual page, on a per-user basis. Usage is simple, and is best illustrated + with an example. If you set + .BR user_config_dir + to be +-.BR /etc/vsftpd_user_conf ++.BR /etc/vsftpd/user_conf + and then log on as the user "chris", then vsftpd will apply the settings in + the file +-.BR /etc/vsftpd_user_conf/chris ++.BR /etc/vsftpd/user_conf/chris + for the duration of the session. The format of this file is as detailed in + this manual page! PLEASE NOTE that not all settings are effective on a + per-user basis. For example, many settings only prior to the user's session + being started. Examples of settings which will not affect any behviour on + a per-user basis include listen_address, banner_file, max_per_ip, max_clients, +@@ -1022,11 +1022,11 @@ + .B userlist_file + This option is the name of the file loaded when the + .BR userlist_enable + option is active. + +-Default: /etc/vsftpd.user_list ++Default: /etc/vsftpd/user_list + .TP + .B vsftpd_log_file + This option is the name of the file to which we write the vsftpd style + log file. This log is only written if the option + .BR xferlog_enable diff --git a/net-ftp/vsftpd/files/vsftpd-2.2.0-logging.patch b/net-ftp/vsftpd/files/vsftpd-2.2.0-logging.patch new file mode 100644 index 0000000..b6b5e7c --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd-2.2.0-logging.patch @@ -0,0 +1,12 @@ +diff -Nur vsftpd-2.0.5/logging.c vsftpd-2.0.5.1/logging.c +--- vsftpd-2.0.5/logging.c 2005-05-25 23:04:17.000000000 +0800 ++++ vsftpd-2.0.5.1/logging.c 2007-03-04 13:37:14.000000000 +0800 +@@ -159,7 +159,7 @@ + return; + } + } +- str_replace_unprintable(p_str, '?'); ++ /*str_replace_unprintable(p_str, '?');*/ + str_append_char(p_str, '\n'); + /* Ignore write failure; maybe the disk filled etc. */ + (void) str_write_loop(p_str, fd); diff --git a/net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch b/net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch new file mode 100644 index 0000000..330026e --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd-2.3.2-as-needed.patch @@ -0,0 +1,13 @@ +Index: vsftpd-2.3.2/Makefile +=================================================================== +--- vsftpd-2.3.2.orig/Makefile ++++ vsftpd-2.3.2/Makefile +@@ -21,7 +21,7 @@ OBJS = main.o utility.o prelogin.o ftpcm + $(CC) -c $*.c $(CFLAGS) $(IFLAGS) + + vsftpd: $(OBJS) +- $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) $(LDFLAGS) ++ $(CC) -o vsftpd $(LDFLAGS) $(OBJS) $(LINK) $(LIBS) + + install: + if [ -x /usr/local/sbin ]; then \ diff --git a/net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch b/net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch new file mode 100644 index 0000000..702363e --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd-2.3.2-kerberos.patch @@ -0,0 +1,20 @@ +Index: vsftpd-2.3.2/twoprocess.c +=================================================================== +--- vsftpd-2.3.2.orig/twoprocess.c ++++ vsftpd-2.3.2/twoprocess.c +@@ -284,6 +284,7 @@ process_login_req(struct vsf_session* p_ + { + enum EVSFPrivopLoginResult e_login_result = kVSFLoginNull; + char cmd; ++ vsf_sysutil_install_null_sighandler(kVSFSysUtilSigCHLD); + /* Blocks */ + cmd = priv_sock_get_cmd(p_sess->parent_fd); + if (cmd != PRIV_SOCK_LOGIN) +@@ -363,7 +364,6 @@ common_do_login(struct vsf_session* p_se + int was_anon = anon; + const struct mystr* p_orig_user_str = p_user_str; + int newpid; +- vsf_sysutil_install_null_sighandler(kVSFSysUtilSigCHLD); + /* Tells the pre-login child all is OK (it may exit in response) */ + priv_sock_send_result(p_sess->parent_fd, PRIV_SOCK_RESULT_OK); + if (!p_sess->control_use_ssl) diff --git a/net-ftp/vsftpd/files/vsftpd.conf b/net-ftp/vsftpd/files/vsftpd.conf new file mode 100644 index 0000000..2ed7008 --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd.conf @@ -0,0 +1,105 @@ +# +# Example vsftpd config file +# +# See man 5 vsftpd.conf for more information. +# +# $Header: /var/cvsroot/gentoo-x86/net-ftp/vsftpd/files/vsftpd.conf,v 1.6 2005/08/03 09:38:31 uberlord Exp $ + +# Enable vsftpd to run as a standalone daemon +# Comment these two out to run under inetd or xinetd +background=YES +listen=YES + +# Allow anonymous FTP? +anonymous_enable=YES + +# Uncomment this to allow local users to log in. +#local_enable=YES + +# Uncomment this to enable any form of FTP write command. +#write_enable=YES + +# Default umask for local users is 077. You may wish to change this to 022, +# if your users expect that (022 is used by most other ftpd's) +#local_umask=022 + +# Uncomment this to allow the anonymous FTP user to upload files. This only +# has an effect if the above global write enable is activated. Also, you will +# obviously need to create a directory writable by the FTP user. +#anon_upload_enable=YES + +# Uncomment this if you want the anonymous FTP user to be able to create +# new directories. +#anon_mkdir_write_enable=YES + +# Activate directory messages - messages given to remote users when they +# go into a certain directory. +dirmessage_enable=YES + +# Make sure PORT transfer connections originate from port 20 (ftp-data). +connect_from_port_20=YES + +# If you want, you can arrange for uploaded anonymous files to be owned by +# a different user. Note! Using "root" for uploaded files is not +# recommended! +#chown_uploads=YES +#chown_username=whoever + +# Activate logging of uploads/downloads. +xferlog_enable=YES + +# If you want, you can have your log file in standard ftpd xferlog format +#xferlog_std_format=YES + +# You may override where the log file goes if you like. +xferlog_file=/var/log/vsftpd.log + +# You may change the default value for timing out an idle session. +#idle_session_timeout=600 + +# You may change the default value for timing out a data connection. +#data_connection_timeout=120 + +# It is recommended that you define on your system a unique user which the +# ftp server can use as a totally isolated and unprivileged user. +nopriv_user=nobody + +# Enable this and the server will recognise asynchronous ABOR requests. Not +# recommended for security (the code is non-trivial). Not enabling it, +# however, may confuse older FTP clients. +#async_abor_enable=YES + +# By default the server will pretend to allow ASCII mode but in fact ignore +# the request. Turn on the below options to have the server actually do ASCII +# mangling on files when in ASCII mode. +# Beware that turning on ascii_download_enable enables malicious remote parties +# to consume your I/O resources, by issuing the command "SIZE /big/file" in +# ASCII mode. +# These ASCII options are split into upload and download because you may wish +# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking), +# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be +# on the client anyway.. +#ascii_upload_enable=YES +#ascii_download_enable=YES + +# You may fully customise the login banner string: +#ftpd_banner=Welcome to blah FTP service. + +# You may specify a file of disallowed anonymous e-mail addresses. Apparently +# useful for combatting certain DoS attacks. +#deny_email_enable=YES +# (default follows) +#banned_email_file=/etc/vsftpd/banned_emails + +# You may specify an explicit list of local users to chroot() to their home +# directory. If chroot_local_user is YES, then this list becomes a list of +# users to NOT chroot(). +#chroot_list_enable=YES +# (default follows) +#chroot_list_file=/etc/vsftpd/chroot_list + +# You may activate the "-R" option to the builtin ls. This is disabled by +# default to avoid remote users being able to cause excessive I/O on large +# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume +# the presence of the "-R" option, so there is a strong case for enabling it. +#ls_recurse_enable=YES diff --git a/net-ftp/vsftpd/files/vsftpd.init b/net-ftp/vsftpd/files/vsftpd.init new file mode 100644 index 0000000..e486e1f --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd.init @@ -0,0 +1,69 @@ +#!/sbin/runscript +# Copyright 2003-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 +# $Header: /var/cvsroot/gentoo-x86/net-ftp/vsftpd/files/vsftpd.init,v 1.7 2008/12/26 16:50:15 armin76 Exp $ + +VSFTPD_NAME=${SVCNAME##*.} +if [ -n "${VSFTPD_NAME}" -a "${SVCNAME}" != "vsftpd" ]; then + VSFTPD_PID="/var/run/vsftpd.${VSFTPD_NAME}.pid" + VSFTPD_CONF_DEFAULT="/etc/vsftpd/${VSFTPD_NAME}.conf" +else + VSFTPD_PID="/var/run/vsftpd.pid" + VSFTPD_CONF_DEFAULT="/etc/vsftpd/vsftpd.conf" +fi +VSFTPD_CONF=${VSFTPD_CONF:-${VSFTPD_CONF_DEFAULT}} +VSFTPD_EXEC=${VSFTPD_EXEC:-/usr/sbin/vsftpd} + +depend() { + need net + use dns logger +} + +checkconfig() { + if [ ! -e ${VSFTPD_CONF} ] ; then + eerror "Please setup ${VSFTPD_CONF} before starting vsftpd" + eerror "There are sample configurations in /usr/share/doc/vsftpd" + return 1 + fi + + if egrep -iq "^ *background *= *yes" "${VSFTPD_CONF}" ; then + eerror "${VSFTPD_CONF} must not set background=YES" + return 1 + fi + + local has_ip=false has_ipv6=false ip_error=true + egrep -iq "^ *listen *= *yes" "${VSFTPD_CONF}" && has_ip=true + egrep -iq "^ *listen_ipv6 *= *yes" "${VSFTPD_CONF}" && has_ipv6=true + if ${has_ip} && ! ${has_ipv6} ; then + ip_error=false + elif ! ${has_ip} && ${has_ipv6} ; then + ip_error=false + fi + if ${ip_error} ; then + eerror "${VSFTPD_CONF} must contain listen=YES or listen_ipv6=YES" + eerror "but not both" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec ${VSFTPD_EXEC} \ + --background --make-pidfile --pidfile "${VSFTPD_PID}" \ + -- "${VSFTPD_CONF}" + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + if [ -f ${VSFTPD_PID} ]; then + start-stop-daemon --stop --pidfile ${VSFTPD_PID} + else + ewarn "Couldn't found ${VSFTPD_PID} trying to stop over the process name ${SVCNAME}" + start-stop-daemon --stop --name ${SVCNAME} + fi + eend $? +} + +# vim: ts=4 diff --git a/net-ftp/vsftpd/files/vsftpd.logrotate b/net-ftp/vsftpd/files/vsftpd.logrotate new file mode 100644 index 0000000..f443e2e --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd.logrotate @@ -0,0 +1,4 @@ +/var/log/vsftpd.log { + missingok + notifempty +} diff --git a/net-ftp/vsftpd/files/vsftpd.xinetd b/net-ftp/vsftpd/files/vsftpd.xinetd new file mode 100644 index 0000000..d1d88e9 --- /dev/null +++ b/net-ftp/vsftpd/files/vsftpd.xinetd @@ -0,0 +1,15 @@ +# default: off +# description: Vsftpd is an FTP server, designed to be secure. +# $Header: /var/cvsroot/gentoo-x86/net-ftp/vsftpd/files/vsftpd.xinetd,v 1.4 2005/06/07 18:34:17 uberlord Exp $ + +service ftp +{ + socket_type = stream + wait = no + user = root + server = /usr/sbin/vsftpd + server_args = /etc/vsftpd/vsftpd.conf + log_on_success += DURATION + nice = 10 + disable = yes +} |