
                            The Cywgin Port Of Dnrd
			    -----------------------

1.  Introduction

This report describes the Cygwin/Win32 port of dnrd that was submitted in
January 2005.  This port was made as a modification to the distribution
dnrd-2.18.  The port produces a dnrd executable that will run on a PC that has
the Cygwin environment installed.

2.  General Strategy

The port is designed to be a minimal change to the dnrd source distribution.

The port follows the design of dnrd in insisting that certain security
requirements are met before running dnrd.  For example, dnrd must run as an
unpriveleged process.

3.  What Is Provided

This port consists of changes to several source files, and the addition of some
new files.  

The changed files are:
 o args.c
 o common.c
 o common.h
 o main.c

The new files are
 o cygwin_post_install.sh
 o cygwin_notes.txt (this file)

Note that the port does not include updated man pages or README files.

4.  Requirements for Building and Using the Cygwin Port of Dnrd

The port is intended to work on Windows NT and above.  It requires that the
Cygwin /etc directory be located on an NTFS file system.

On a Win32 computer, the following Cygwin components must be installed:
 o The Base category
 o The Devel category (or at least gcc)
 o The editrights package
 o The cygrunsrv package

Administrators priveleges are required to install dnrd.

4.  Properties of the Executable

The port produces a dnrd.exe file that is intended to run as an
unpriveleged Win32 local service.  For this reason, dnrd will not spawn a
subprocess under Cygwin.

The dnrd command line option "-u" (--userid) is not present under Cygwin.  A
different userid can be chosen for dnrd when it is installed as a Win32
service.

The existing dnrd insists on certain protections and ownerships of files such
as /usr/local/etc/dnrd/.  The Cygwin port of dnrd insists on slightly 
different rules.

5.  Building Dnrd

The modified source files (see section 3. above) use a preprocessor symbol
__CYGWIN__.  If this symbol is not defined, then dnrd will build exactly as it
did before the port was merged into the distribution.  The output generated by
the C language preprocessor is not changed in the least (except for line
numbers).

Building and installing dnrd begins with the same three steps as before:
 o configure
 o make
 o make install

Now additional work is required:
 o Set file ownership and permissions of /var/empty and /var/log/dnrd.log.
 o Create an unpriveleged user to run dnrd as a service
 o Create a Win32 service to run dnrd

A shell script cygwin_post_install.sh is provided for this purpose.
Unfortunately, the dnrd user must edit this shell script before use.  The
script is not completely generic.

6.  Conclusion

I have been using the Cygwin port of dnrd 24/7 for several weeks now.  It
appears to be completely stable.  However, much testing on different platforms
and environments is clearly needed.

I suspect that many users will be frustrated by post installation failures
related to file ownerships and file permissions.  Perhaps the script
cygwin_post_install.sh can be improved after some feedback from users.

It might be a good idea to remove the "-w" (--windows) command line option and
simply prevent spawning subprocesses.  This is a matter of taste really.

The command line option "-u" (--userid) should perhaps be removed, since it
will fail under the Cygwin environment.

Any suggestions regarding this port are most welcome!
