Author: twittner Date: Sat Jun 18 11:38:54 2005 New Revision: 6126 Added: pure-config/trunk/Makefile pure-config/trunk/Makefile.am pure-config/trunk/README pure-config/trunk/USAGE pure-config/trunk/autogen.sh (contents, props changed) pure-config/trunk/configure.ac pure-config/trunk/pure-config.c pure-config/trunk/pure-config.h pure-config/trunk/pureftpd.conf pure-config/trunk/release.sh (contents, props changed) Log: - place new ver. in trunk
Added: pure-config/trunk/Makefile ============================================================================== --- (empty file) +++ pure-config/trunk/Makefile Sat Jun 18 11:38:54 2005 @@ -0,0 +1,10 @@ +CC = cc +CFLAGS = +LDFLAGS = + +pure-config: pure-config.c pure-config.h + $(CC) -lcfg+ $(CFLAGS) $(LDFLAGS) -Wall -o $@ $< + +clean: + rm -f pure-config + Added: pure-config/trunk/Makefile.am ============================================================================== --- (empty file) +++ pure-config/trunk/Makefile.am Sat Jun 18 11:38:54 2005 @@ -0,0 +1,4 @@ +sbin_PROGRAMS = pure-config + +pure_config_SOURCES = pure-config.c pure-config.h + Added: pure-config/trunk/README ============================================================================== --- (empty file) +++ pure-config/trunk/README Sat Jun 18 11:38:54 2005 @@ -0,0 +1,103 @@ +* Program: pure-config + +* Description: Main configuration file's parser/converter for pure-ftpd + server written in C, on the top of libcfg+ - see: + http://platon.sk/projects/libcfg+/. + +* Copyright: Tomasz Wittner, 2004 under terms of GNU GPL v.2 license. + + +1. Building this software on Linux: + + a). Special prerequisites. + At first you have to have libcfg+ library installed in your system. For + futher informations about building and instalation of libcfg+ library + see at http://platon.sk/projects/libcfg+/. + + b). Compilation and instalation. + Run `make CFLAGS='-O2' ' in source directory. After successul compilation + copy pure-config binary wherever you need. + +2. Usage. + + a). From commandline. + [EMAIL PROTECTED] 6:66 ~]# pure-fptd $( pure-config -f /etc/pure-ftpd.conf [-d|--debug] [-l|--long] ) \ + [--put_here_additional_pure-ftpd\'s_options|...] + f.e.: + [EMAIL PROTECTED] 6:66 ~]# pure-fptd $( pure-config -f /etc/pure-ftpd.conf -l ) --daemonize + + b). From PLD Linux Distribution's initscript. + +#!/bin/sh +# +# pureftpd PureFTPD server +# +# chkconfig: 345 85 15 +# description: PureFTPD is fast, production-quality, standard-conformant FTP server +# + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Get service config +[ -f /etc/sysconfig/pure-ftpd ] && . /etc/sysconfig/pure-ftpd + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + # nls "ERROR: Networking is down. %s can't be run." <service> + msg_network_down pure-ftpd + exit 1 + fi +else + exit 0 +fi + +RETVAL=0 +# See how we were called. +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/pure-ftpd ]; then + msg_starting pure-ftpd + rm -f /var/run/pure-ftpd/client* + daemon pure-ftpd $(pure-config -f /etc/ftpd/pureftpd.conf -l) --daemonize + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pure-ftpd + else + msg_already_running pure-ftpd + fi + ;; + stop) + # Stop daemons. + if [ -f /var/lock/subsys/pure-ftpd ]; then + msg_stopping pure-ftpd + killproc pure-ftpd + rm -f /var/lock/subsys/pure-ftpd > /dev/null 2>&1 + else + msg_not_running pure-ftpd + fi + ;; + status) + status pure-ftpd + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + pure-ftpwho + fi + ;; + restart|force-reload) + $0 stop + $0 start + exit $? + ;; + *) + msg_usage "$0 {start|stop|restart|force-reload|status}" + exit 3 + ;; +esac + +exit $RETVAL + Added: pure-config/trunk/USAGE ============================================================================== --- (empty file) +++ pure-config/trunk/USAGE Sat Jun 18 11:38:54 2005 @@ -0,0 +1 @@ +# pure-fptd $(pure-config -f /etc/pure-ftpd.conf [-d|--debug] [-l|--long]) [--put_here_additional_pure-ftpd\'s_options|...] Added: pure-config/trunk/autogen.sh ============================================================================== --- (empty file) +++ pure-config/trunk/autogen.sh Sat Jun 18 11:38:54 2005 @@ -0,0 +1,28 @@ +#!/bin/sh -x + +rm -fr aclocal.m4 \ + autom4te.cache \ + config.h \ + config.h.in \ + config.h.in~ \ + config.log \ + config.status \ + configure \ + configure.scan \ + depcomp \ + install-sh \ + Makefile \ + Makefile.in \ + missing \ + pure-config \ + pure-config.o \ + stamp-h1 \ + .deps + +[ x"$@" = "xclean" ] && exit 0 + +aclocal +autoconf +autoheader +automake -a -c -f --foreign + Added: pure-config/trunk/configure.ac ============================================================================== --- (empty file) +++ pure-config/trunk/configure.ac Sat Jun 18 11:38:54 2005 @@ -0,0 +1,35 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT(pure-config, 20041201) +AC_CONFIG_SRCDIR([pure-config.c]) +AC_CONFIG_HEADER([config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(errno.h cfg+.h) + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. +AC_CHECK_FUNCS([strncasecmp]) + +AC_CHECK_LIB([cfg+], [cfg_get_context]) +AC_CHECK_FUNCS(cfg_set_cmdline_context \ + cfg_parse \ + cfg_fprint_error \ + cfg_add_property \ + cfg_set_cfgfile_context \ + , , AC_MSG_ERROR(Your cfg+ library seems broken. Goodbye.) + ) + +AM_INIT_AUTOMAKE +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT + Added: pure-config/trunk/pure-config.c ============================================================================== --- (empty file) +++ pure-config/trunk/pure-config.c Sat Jun 18 11:38:54 2005 @@ -0,0 +1,206 @@ +/* + * vim:tw=130:sw=4:ts=4 + * + * Program name: pure-config + * + * Description: Parser-converter for main configuration pure-ftpd file + * written in C, on the top of libcfg+ - see: + * http://platon.sk/projects/libcfg+/. + * + * Copyright: Tomasz Wittner, 2004, 2005 under terms of GNU GPL v.2 license + * + */ + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "pure-config.h" + +static char *blank_char_pos(char *s); /* returns pointer to first blank character (' ' or '\t') in s or NULL if any not found. */ +static char *rm_blanks(char *s); /* removes blanks (' ' or '\t') from s . */ +static int usage(void); /* prints standard `usage' message */ +static int version(void); /* prints informaton about program */ + +int main(int argc, char **argv) +{ + int i, j, ret; + char *sc; /* place for semicolon instead blank between numbers */ + + CFG_CONTEXT con = cfg_get_context(options); + + if(!con) + { + fprintf(stderr, "Error: can\'t allocate memory. Program exited.\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, ENOMEM); + + exit(ENOMEM); + } + + cfg_set_cmdline_context(con, 1, -1, argv); + + ret = cfg_parse(con); + + if(ret < 0) + { + cfg_fprint_error(con, stderr); + fprintf(stderr, "\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, ret); + + exit(ret); + } + + if(opt[HELP]) + usage(); + + if (opt[VERSIONOPT]) + version(); + + ret = cfg_add_property(con, CFG_FILE_OPTION_ARG_SEPARATOR, " "); /* OK = ret 1, BAD = 0 */ + + if(!ret) + { + cfg_fprint_error(con, stderr); + fprintf(stderr, "\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, ret); + + exit(ret); + } + + ret = cfg_add_property(con, CFG_FILE_OPTION_ARG_SEPARATOR, "\t"); + if(!ret) + { + cfg_fprint_error(con, stderr); + fprintf(stderr, "\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, ret); + + exit(ret); + } + + if(opt[CFGFILE]) + cfg_set_cfgfile_context(con, 0, -1, opt[CFGFILE]); + + else + { + fprintf(stderr, "Error: file for parsing not given.\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, ret); + + exit(1); + } + + ret = cfg_parse(con); + + if(ret < 0) + { + cfg_fprint_error(con, stderr); + fprintf(stderr, "\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, ret); + + exit(ret); + } + + for( i = 4 ; i <= OPTQNT - 1 ; i++) + { + if(opt[i] && strncasecmp("no", opt[i], 2)) { + + if(!strncasecmp("yes", opt[i], 3)) + printf(" %s", output[i][(opt[LONGOPT]) ? 1 : 0]); + + else + { + if( i >= SEMICOL_S && i <= SEMICOL_E && opt[i] ) { /* convert '1 2' to '1:2' */ + sc = opt[i]; + + if( (sc = blank_char_pos(sc)) ) + { + *sc = ':'; + opt[i] = rm_blanks( opt[i] ); + } + } + + printf(" %s%s", output[i][(opt[LONGOPT]) ? 1 : 0], opt[i]); + } + } + } + + printf("\n"); + + if(opt[DEBUG]) + fprintf(stderr, "In %s at %d line program exited with %d code.\n", __FILE__, __LINE__ + 2, EXIT_SUCCESS); + + cfg_free_context(con); + return EXIT_SUCCESS; +} + +static char *rm_blanks(char *s) +{ + char *p, *t; + p = t = s; + + while( p && *p != '\0' ) + { + if( *p != ' ' && *p != '\t' ) + *t++ = *p++; + + else + p++; + } + + *t = '\0'; + return s; +} + +static char *blank_char_pos(char *s) { + + char *t = s; + + for( ; t && *t != '\0' && *t != ' ' && *t != '\t' ; t++ ) + ; + + if( t && *t != '\0' ) + + return t; + + return NULL; +} + +static int usage(void) { + + puts(""); + puts("pure-config main pure-ftpd configuration file parser."); + puts(" parses configuration file and prints pure-ftpd commandline"); + puts(" options on stdout."); + puts(""); + puts("Usage:"); + puts(" pure-config -d, --debug print some debug information on stderr"); + puts(" pure-config -f, --file=/path/to/pureftpd.conf parse given pure-ftpd configuration file"); + puts(" pure-config -h, --help print this message on stdout and exit"); + puts(" pure-config -l, --long print long names of pure-ftpd options"); + puts(" pure-config -V, --version print version number of pure-ftpd and exit"); + puts(""); + puts("Example of usage:"); + puts(" pure-ftpd $(pure-config -f /etc/pure-ftpd/pureftpd.conf)"); + puts(""); + exit(EXIT_SUCCESS); +} + +static version(void) { + + puts(""); + puts("pure-config main pure-ftpd configuration file parser."); + puts("version: " VERSION ); + exit(EXIT_SUCCESS); +} Added: pure-config/trunk/pure-config.h ============================================================================== --- (empty file) +++ pure-config/trunk/pure-config.h Sat Jun 18 11:38:54 2005 @@ -0,0 +1,177 @@ +/* + * vim:tw=180:ts=8:sw=8 + * + * Program name: pure-config + * + * Description: Parser-converter for main configuration pure-ftpd file + * written in C, on the top of libcfg+ - see: + * http://platon.sk/projects/libcfg+/. + * + * Copyright: Tomasz Wittner, 2004 under terms of GNU GPL v.2 license. + * + */ + +#ifndef PURE_CONFIG_H +#define PURE_CONFIG_H 1 + +#include "config.h" +#ifdef HAVE_CFG__H +#include <cfg+.h> +#endif /* HAVE_CFG__H */ + +#define OPTQNT 66 +#define CFGFILE 0 +#define DEBUG 1 +#define HELP 2 +#define LONGOPT 3 +#define VERSIONOPT 5 +#define SEMICOL_S 52 +#define SEMICOL_E SEMICOL_S + 7 +#define I __LINE__ - 38 + + +char *opt[OPTQNT]; + +struct cfg_option options[] = { + +/* cmdline_long, cmdline_short, cfgfile_name, cfg_option_type, value val */ +{ "file", 'f', NULL, CFG_STR, (void*) &opt[I], 0 }, +{ "debug", 'd', NULL, CFG_BOOL, (void*) &opt[I], 0 }, +{ "help", 'h', NULL, CFG_BOOL, (void*) &opt[I], 0 }, +{ "long", 'l', NULL, CFG_BOOL, (void*) &opt[I], 0 }, +{ "verbose", 'v', NULL, CFG_BOOL, (void*) &opt[I], 0 }, /* not implemented */ +{ "version", 'V', NULL, CFG_BOOL, (void*) &opt[I], 0 }, /* mainly for help2man */ +{ NULL, '\0', /* '4' */ "IPV4Only", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* '6' */ "IPV6Only", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'A' */ "ChrootEveryone", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'b' */ "BrokenClientsCompatibility", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'B' */ "Daemonize", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'd' */ "VerboseLog", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'D' */ "DisplayDotFiles", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'e' */ "AnonymousOnly", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'E' */ "NoAnonymous", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'H' */ "DontResolve", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'M' */ "AnonymousCanCreateDirs", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'N' */ "NATmode", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'o' */ "CallUploadScript", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 's' */ "AntiWarez", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'w' */ "AllowUserFXP", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'W' */ "AllowAnonymousFXP", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'x' */ "ProhibitDotFilesWrite", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'X' */ "ProhibitDotFilesRead", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'z' */ "AllowDotFiles", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'r' */ "AutoRename", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'i' */ "AnonymousCantUpload", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* '1' */ "LogPID", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'R' */ "NoChmod", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'K' */ "KeepAllFiles", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'j' */ "CreateHomeDir", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'G' */ "NoRename", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'Z' */ "CustomerProof", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* '0' */ "NoTruncate", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'f' */ "SyslogFacility", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'F' */ "FortunesFile", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'P' */ "ForcePassiveIP", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'S' */ "Bind", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 't' */ "AnonymousBandwidth", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'T' */ "UserBandwidth", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'V' */ "TrustedIP", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'O' */ "AltLog", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'g' */ "PIDFile", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* '7' */ "SSLCertFile", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'I' */ "MaxIdleTime", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'k' */ "MaxDiskUsage", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'a' */ "TrustedGID", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'c' */ "MaxClientsNumber", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'C' */ "MaxClientsPerIP", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'm' */ "MaxLoad", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'u' */ "MinUID", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'Y' */ "TLS", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'L' */ "LimitRecursion", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'p' */ "PassivePortRange", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'q' */ "AnonymousRatio", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'Q' */ "UserRatio", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'U' */ "Umask", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'n' */ "Quota", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* 'y' */ "PerUserLimits", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lldap: */ "LDAPConfigFile", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lmysql: */ "MySQLConfigFile", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lpgsql: */ "PGSQLConfigFile", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lpuredb: */ "PureDB", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lextauth: */ "ExtAuth", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lpam */ "PAMAuthentication", CFG_STR, (void*) &opt[I], 0 }, +{ NULL, '\0', /* lunix */ "UnixAuthentication", CFG_STR, (void*) &opt[I], 0 }, + CFG_END_OF_LIST +}; + +char *output[OPTQNT][2] = { + + { "", "" }, + { "", "" }, + { "", "" }, + { "", "" }, + { "", "" }, + { "", "" }, + { "-4", "--ipv4only" }, + { "-6", "--ipv6only" }, + { "-A", "--chrooteveryone" }, + { "-b", "--brokenclientscompatibility" }, + { "-B", "--daemonize" }, + { "-d", "--verboselog" }, + { "-D", "--displaydotfiles" }, + { "-e", "--anonymousonly" }, + { "-E", "--noanonymous" }, + { "-H", "--dontresolve" }, + { "-M", "--anonymouscancreatedirs" }, + { "-N", "--natmode" }, + { "-o", "--calluploadscript" }, + { "-s", "--antiwarez" }, + { "-w", "--allowuserfxp" }, + { "-W", "--allowanonymousfxp" }, + { "-x", "--prohibitdotfileswrite" }, + { "-X", "--prohibitdotfilesread" }, + { "-z", "--allowdotfiles" }, + { "-r", "--autorename" }, + { "-i", "--anonymouscantupload" }, + { "-1", "--logpid=" }, + { "-R", "--nochmod" }, + { "-K", "--keepallfiles" }, + { "-j", "--createhomedir" }, + { "-G", "--norename" }, + { "-Z", "--customerproof" }, + { "-0", "--notruncate" }, + { "-f", "--syslogfacility=" }, + { "-F", "--fortunesfile=" }, + { "-P", "--forcepassiveip=" }, + { "-S", "--bind=" }, + { "-t", "--anonymousbandwidth=" }, + { "-T", "--userbandwidth=" }, + { "-V", "--trustedip=" }, + { "-O", "--altlog=" }, + { "-g", "--pidfile=" }, + { "-7", "--sslcertfile=" }, + { "-I", "--maxidletime=" }, + { "-k", "--maxdiskusage=" }, + { "-a", "--trustedgid=" }, + { "-c", "--maxclientsnumber=" }, + { "-C", "--maxclientsperip=" }, + { "-m", "--maxload=" }, + { "-u", "--minuid=" }, + { "-Y", "--tls=" }, + { "-L", "--limitrecursion=" }, + { "-p", "--passiveportrange=" }, + { "-q", "--anonymousratio=" }, + { "-Q", "--userratio=" }, + { "-U", "--umask=" }, + { "-n", "--quota=" }, + { "-y", "--peruserlimits=" }, + { "-lldap:", "--login=ldap:" }, + { "-lmysql:", "--login=mysql:" }, + { "-lpgsql:", "--login=pgsql:" }, + { "-lpuredb:", "--login=puredb:" }, + { "-lextauth:", "--login=extauth:" }, + { "-lpam", "--login=pam" }, + { "-lunix", "--login=unix" } + +}; +#endif /* PURE_CONFIG_H */ Added: pure-config/trunk/pureftpd.conf ============================================================================== --- (empty file) +++ pure-config/trunk/pureftpd.conf Sat Jun 18 11:38:54 2005 @@ -0,0 +1,317 @@ + +############################################################ +# # +# Configuration file for pure-ftpd wrappers # +# # +############################################################ + +# If you want to run Pure-FTPd with this configuration +# instead of command-line options, please run the +# following command : +# +# /usr/sbin/pure-config.pl /usr/etc/pure-ftpd.conf +# +# Please don't forget to have a look at documentation at +# http://www.pureftpd.org/documentation.html for a complete list of +# options. + +# Cage in every user in his home directory +ChrootEveryone yes + +# If the previous option is set to "no", members of the following group +# won't be caged. Others will be. If you don't want chroot()ing anyone, +# just comment out ChrootEveryone and TrustedGID. + + TrustedGID 100 + +# Turn on compatibility hacks for broken clients +BrokenClientsCompatibility yes + +# Maximum number of simultaneous users +MaxClientsNumber 50 + +# Fork in background +Daemonize yes + +# Maximum number of sim clients with the same IP address +MaxClientsPerIP 8 + +# If you want to log all client commands, set this to "yes". +# This directive can be duplicated to also log server responses. +VerboseLog yes + +# List dot-files even when the client doesn't send "-a". +DisplayDotFiles yes + +# Don't allow authenticated users - have a public anonymous FTP only. +AnonymousOnly no + +# Disallow anonymous connections. Only allow authenticated users. +NoAnonymous yes + +# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*) +# The default facility is "ftp". "none" disables logging. +SyslogFacility ftp + +# Display fortune cookies + +# FortunesFile /usr/share/fortune/zippy + +# Don't resolve host names in log files. Logs are less verbose, but +# it uses less bandwidth. Set this to "yes" on very busy servers or +# if you don't have a working DNS. +DontResolve yes + +# Maximum idle time in minutes (default = 15 minutes) + +MaxIdleTime 15 + +# LDAP configuration file (see README.LDAP) + +# LDAPConfigFile /etc/ftpd/pureftpd-ldap.conf + +# MySQL configuration file (see README.MySQL) +# MySQLConfigFile /etc/ftpd/pureftpd-mysql.conf + +# Postgres configuration file (see README.PGSQL) + +# PGSQLConfigFile /etc/ftpd/pureftpd-pgsql.conf + + +# PureDB user database (see README.Virtual-Users) + +PureDB /etc/ftpd/pureftpd.pdb + + +# Path to pure-authd socket (see README.Authentication-Modules) + + ExtAuth /var/run/ftpd.sock + +# If you want to enable PAM authentication, uncomment the following line + + PAMAuthentication yes + +# If you want simple Unix (/etc/passwd) authentication, uncomment this + + UnixAuthentication yes + +# Please note that LDAPConfigFile, MySQLConfigFile, PAMAuthentication and +# UnixAuthentication can be used only once, but they can be combined +# together. For instance, if you use MySQLConfigFile, then UnixAuthentication, +# the SQL server will be asked. If the SQL authentication fails because the +# user wasn't found, another try # will be done with /etc/passwd and +# /etc/shadow. If the SQL authentication fails because the password was wrong, +# the authentication chain stops here. Authentication methods are chained in +# the order they are given. + +# 'ls' recursion limits. The first argument is the maximum number of +# files to be displayed. The second one is the max subdirectories depth + +LimitRecursion 2000 8 + +# Are anonymous users allowed to create new directories ? +AnonymousCanCreateDirs no + +# If the system is more loaded than the following value, +# anonymous users aren't allowed to download. +MaxLoad 50 + +# Port range for passive connections replies. - for firewalling. + PassivePortRange 30000 50000 + +# Force an IP address in PASV/EPSV/SPSV replies. - for NAT. +# Symbolic host names are also accepted for gateways with dynamic IP +# addresses. + + ForcePassiveIP 192.168.0.10 + +# Upload/download ratio for anonymous users. + + AnonymousRatio 1 10 + +# Upload/download ratio for all users. +# This directive superscedes the previous one. + + UserRatio 1 10 + +# Disallow downloading of files owned by "ftp", ie. +# files that were uploaded but not validated by a local admin. + +AntiWarez yes + +# IP address/port to listen to (default=all IP and port 21). + Bind 127.0.0.1,21 + +# Maximum bandwidth for anonymous users in KB/s + + AnonymousBandwidth 8 + +# Maximum bandwidth for *all* users (including anonymous) in KB/s +# Use AnonymousBandwidth *or* UserBandwidth, both makes no sense. + + UserBandwidth 8 + +# File creation mask. <umask for files>:<umask for dirs> . +# 177:077 if you feel paranoid. +# Umask 133:022 +Umask 177:077 + +# Minimum UID for an authenticated user to log in. + +MinUID 100 + +# Allow FXP transfers for authenticated users only. +AllowUserFXP yes + +# Allow anonymous FXP for anonymous and non-anonymous users. +AllowAnonymousFXP no + +# Users can't delete/write files beginning with a dot ('.') +# even if they own them. If TrustedGID is enabled, this group +# will have access to dot-files, though. +ProhibitDotFilesWrite no + +# Prohibit *reading* of files beginning with a dot (.history, .ssh...) +ProhibitDotFilesRead no + +# Never overwrite files. When a file whoose name already exist is uploaded, +# it get automatically renamed to file.1, file.2, file.3, ... +AutoRename no + +# Disallow anonymous users to upload new files (no = upload is allowed) +AnonymousCantUpload yes + +# Only connections to this specific IP address are allowed to be +# non-anonymous. You can use this directive to open several public IPs for +# anonymous FTP, and keep a private firewalled IP for remote administration. +# You can also only allow a non-routable local IP (like 10.x.x.x) to +# authenticate, and keep a public anon-only FTP server on another IP. + + TrustedIP 127.0.0.1 + +# If you want to add the PID to every logged line, uncomment the following +# line. + + LogPID yes + +# Create an additional log file with transfers logged in a Apache-like format : +# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200 21809338 +# This log file can then be processed by www traffic analyzers. + + AltLog clf:/var/log/pureftpd.log + +# Create an additional log file with transfers logged in a format optimized +# for statistic reports. + + #AltLog stats:/var/log/pureftpd.log + +# Create an additional log file with transfers logged in the standard W3C +# format (compatible with most commercial log analyzers) + + #AltLog w3c:/var/log/pureftpd.log + +# Disallow the CHMOD command. Users can't change perms of their files. + + NoChmod yes + +# Allow users to resume and upload files, but *NOT* to delete them. + + KeepAllFiles yes + +# Automatically create home directories if they are missing + + CreateHomeDir yes + +# Enable virtual quotas. The first number is the max number of files. +# The second number is the max size of megabytes. +# So 1000:10 limits every user to 1000 files and 10 Mb. + + Quota 1000:10 + +# If your pure-ftpd has been compiled with standalone support, you can change +# the location of the pid file. The default is /var/run/pure-ftpd.pid + +# PIDFile /var/run/pure-ftpd.pid + +# If your pure-ftpd has been compiled with pure-uploadscript support, +# this will make pure-ftpd write info about new uploads to +# /var/run/pure-ftpd.upload.pipe so pure-uploadscript can read it and +# spawn a script to handle the upload. + + CallUploadScript yes + + + +# This option is useful with servers where anonymous upload is +# allowed. As /var/ftp is in /var, it save some space and protect +# the log files. When the partition is more that X percent full, +# new uploads are disallowed. + + MaxDiskUsage 99 + + + +# Set to 'yes' if you don't want your users to rename files. + + NoRename yes + + + +# Be 'customer proof' : workaround against common customer mistakes like +# 'chmod 0 public_html', that are valid, but that could cause ignorant +# customers to lock their files, and then keep your technical support busy +# with silly issues. If you're sure all your users have some basic Unix +# knowledge, this feature is useless. If you're a hosting service, enable it. + +CustomerProof yes + + + +# Per-user concurrency limits. It will only work if the FTP server has +# been compiled with --with-peruserlimits (and this is the case on +# most binary distributions) . +# The format is : <max sessions per user>:<max anonymous sessions> +# For instance, 3:20 means that the same authenticated user can have 3 active +# sessions max. And there are 20 anonymous sessions max. + + PerUserLimits 3:20 + + + +# When a file is uploaded and there is already a previous version of the file +# with the same name, the old file will neither get removed nor truncated. +# Upload will take place in a temporary file and once the upload is complete, +# the switch to the new version will be atomic. For instance, when a large PHP +# script is being uploaded, the web server will still serve the old version and +# immediatly switch to the new one as soon as the full file will have been +# transfered. This option is incompatible with virtual quotas. + + NoTruncate yes + + + +# This option can accept three values : +# 0 : disable SSL/TLS encryption layer (default). +# 1 : accept both traditional and encrypted sessions. +# 2 : refuse connections that don't use SSL/TLS security mechanisms, +# including anonymous sessions. +# Do _not_ uncomment this blindly. Be sure that : +# 1) Your server has been compiled with SSL/TLS support (--with-tls), +# 2) A valid certificate is in place, +# 3) Only compatible clients will log in. + +TLS 1 +# SSLCertFile /etc/ssl/private/pure-ftpd.pem +SSLCertFile /etc/ftpd/pureftpd.pem +#(current location in PLD) + + +# Listen only to IPv4 addresses in standalone mode (ie. disable IPv6) +# By default, both IPv4 and IPv6 are enabled. + +IPV4Only yes + +# Listen only to IPv6 addresses in standalone mode (ie. disable IPv4) +# By default, both IPv4 and IPv6 are enabled. + +# IPV6Only yes Added: pure-config/trunk/release.sh ============================================================================== --- (empty file) +++ pure-config/trunk/release.sh Sat Jun 18 11:38:54 2005 @@ -0,0 +1,5 @@ +#!/bin/sh + +cp -v pure-config.{c,h} autogen.sh configure.ac Makefile.am README ../public/pure-config/ +[ x"$@" = "xpld" ] && cp -v pure-config.{c,h} autogen.sh configure.ac Makefile.am README \ + ~/my/devel/pld/svn/pure-config/ _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
