This patch cleans up the "Linuxisms" that prevent the service from compiling
on FreeBSD (4.9-PRE tested).

1.  encrypt() is part of the DES library, declared in unistd.h.  Changed
    the local implementation to myencrypt().
2.  Linux allows programmers to #include files out of order, correct one
    instance in socket.c.  (One file was missing as well.)

- Hwy

diff -uNrd security.dist/encrypt.c security/encrypt.c
--- security.dist/encrypt.c	Thu Jan 10 23:32:26 2002
+++ security/encrypt.c	Wed Sep 24 13:32:25 2003
@@ -96,7 +96,7 @@
     strcpy(encoded,cipher(plain));
 }
 
-char *encrypt(char *plain)
+char *myencrypt(char *plain)
 {
     return cipher(plain);
 }
diff -uNrd security.dist/nickserv.c security/nickserv.c
--- security.dist/nickserv.c	Mon Jan 21 22:21:12 2002
+++ security/nickserv.c	Wed Sep 24 13:32:41 2003
@@ -382,7 +382,7 @@
    }
    else
    {
-       curnick = register_nickuser(nick,encrypt(pass),now,curuser->signon);
+       curnick = register_nickuser(nick,myencrypt(pass),now,curuser->signon);
        debug("Nick","%s registered by %s@%s.",nick,curuser->user,curuser->host,pass);
 
        curnick->lastonline = curuser->signon;
@@ -630,19 +630,19 @@
          if (!IsServAdmin(temp)) notice(curuser->nick,"Admin passwords can only be changed by the admin.");
          else
          {
-            strcpy(curnick->pass,encrypt(pass));
+            strcpy(curnick->pass,myencrypt(pass));
             notice(curuser->nick,"Password for %s changed.",curnick->nick);
          }
       }
       else
       {
-         strcpy(curnick->pass,encrypt(pass));
+         strcpy(curnick->pass,myencrypt(pass));
          notice(curuser->nick,"Password for %s changed.",curnick->nick);
       }
    }
    else
    {
-      strcpy(curnick->pass,encrypt(pass));
+      strcpy(curnick->pass,myencrypt(pass));
       notice(curuser->nick,"Password changed.");
    }
 }
diff -uNrd security.dist/proto.h security/proto.h
--- security.dist/proto.h	Sat Jan 12 22:29:38 2002
+++ security/proto.h	Wed Sep 24 13:31:59 2003
@@ -23,7 +23,7 @@
 extern int burst;
 #endif
 
-char *encrypt(char *plain);
+char *myencrypt(char *plain);
 char *create_mask(USERPTR u);
 CONNPTR find_fd(int);
 CHANPTR find_channel(char *);
diff -uNrd security.dist/socket.c security/socket.c
--- security.dist/socket.c	Thu Jan 10 23:28:56 2002
+++ security/socket.c	Wed Sep 24 13:34:48 2003
@@ -18,10 +18,11 @@
  *
  */
 
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
-#include <sys/socket.h>
-#include <sys/types.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/param.h>
