Developer:Main

From Wzdftpd

Jump to: navigation, search

The information on this page, while public, will primarily be of interest to wzdftpd developers.

Contents


Developer's Tools

Subversion

wzdftpd uses subversion as Revision Control System. Subversion is similar to CVS in many ways (and is designed to replace CVS !), and is accessible on all supported platforms.

The Subversion Book is accessible online, and is a good reference on how to use subversion.

A small Subversion Howto is also available on this site.

Public SVN information:

  • server: svn.cpe.fr
  • cvsroot: /svn/wzdftpd
  • protocol: svn+ssh
  • user: svn
  • pass: svn

IMPORTANT the password will probably be asked several times. This is not a bug, this is the normal behaviour.


Examples:

  • list files and check connection
svn list svn+ssh://svn@svn.cpe.fr/svn/wzdftpd
  • extract current HEAD (trunk) branch
svn co svn+ssh://svn@svn.cpe.fr/svn/wzdftpd/trunk
  • list tags (releases)
svn list svn+ssh://svn@svn.cpe.fr/svn/wzdftpd/tags
  • extract stable release 0.5.5
svn co svn+ssh://svn@svn.cpe.fr/svn/wzdftpd/tags/rel-0-5-5

If you want to be able to make changes in the repository, you must ask for an account.


A Web interface is available to browse the repository.


After each commit in the repository, a mail is sent to the mailing list wzdftpd-cvs (subscription is free).

Mailing Lists

Several mailing lists are available:

Bugs

The Bug Tracking System

The Bug Tracking System (BTS) itself, for reporting, discussing, and fixing bugs. Reports of problems in almost any part of wzdftpd are welcome here. The BTS is useful for both users and developers.

Compiling SVN version

Prerequisites

Get svn version

Extract the version or branch you have choosen. We will use the development branch (trunk) here:

$ svn co svn+ssh://svn@svn.cpe.fr/svn/wzdftpd/trunk wzdftpd-trunk

This will create the subdir wzdftpd-trunk and get the latest svn version.

Creating the configure script

You need the autotools: Automake (>= 1.6), Autoconf (>= 2.53), Libtool (>= 1.5)

Run the bootstrap script:

$ ./bootstrap

Configure wzdftpd

Run the configure script. You'll probably need to add some arguments, especially if you want to compile a debug version:

./configure CFLAGS="-g -O0 -W -Wall" --prefix=~/DEL --enable-debug --enable-ipv6

This will configure wzdftpd with debug options (--enable-debug) and IPv6 support. The installation will be done in the $HOME/DEL directory, which is easier to clean up than /usr/local.

CFLAGS is changed for two reasons:

  • disable optimisation (-O0) while we add debugging infos to the code (-g). This is needed, because most debuggers will get confused when both options are enabled (which is the default, due to a stupid autoconf idea)
  • enable warnings (-W -Wall): warnings are here to help you, not annoy you. A good code should have as few warnings as possible

If you use gcc to compile and gdb to debug, you may want to use -ggdb instead of -g, or even -ggdb3. This adds more debuggings infos to the executable, which will greatly help gdb (for ex. this can help debugging macros).

You can also change the compiler the same way, using the CC variable. For ex, to use the Intel C Compiler:

./configure CC="icc" CFLAGS="-g -O0" ...

To compile a release version, just remove the debugging arguments:

$ ./configure --enable-ipv6

Compile and Install

Run the usual commands

$ make

and then

$ make install

Remember that the default installation will not install the configuration and users files, to avoid overwriting your configuration when you reinstall. You will have to copy the example files:

$ cd $HOME/DEL/etc/wzdftpd
$ cp wzd.cfg.sample wzd.cfg
$ cp users.sample users

Edit file wzd.cfg and then start the server the usual way.

Image:icon_info.png if you want to debug wzdftpd, you should change the port variable in the config file to be greater than 1024. This allows you to run the server as a non-privileged user, and to debug it. Remember: never debug wzdftpd running as root unless you have a good reason !

Debugging Tools

GDB

Valgrind

Strace

Ktrace

On all BSDs incl. MacOS X you can use ktrace as replacement for strace. The output not as informative as strace, but still very important for tracking down problems.

ktrace will, once enabled, trace data until the process exists or the trace point is cleared. A traced process can generate enormous amounts of log data quickly; it is strongly suggested that users memorize how to disable tracing before attempting to trace a process. The following command is sufficient to disable tracing on all user owned processes, and, if executed by root, all processes.

$ ktrace -C

To enable tracing run:

$ ktrace -p <wzdftpd.pid> -f wzdftpd.trace

to attach to the process.

Use kdump to get useful data:

$ kdump -f wzdftpd.trace -T -m 4000 -d

For more ways on limiting the output and such, see http://www.openbsd.org/cgi-bin/man.cgi?query=ktrace and http://www.openbsd.org/cgi-bin/man.cgi?query=kdump

Documents for developers

Drafts

Personal tools
documentation