updates.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 4 Nov 2001 09:53:35 +0000 (09:53 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 4 Nov 2001 09:53:35 +0000 (09:53 +0000)
CHANGES
README
configure.in.pre
doc/CodingStyle
doc/example_silc.conf.in [moved from doc/example_silc.conf with 64% similarity]
doc/example_silcd.conf.in [moved from doc/example_silcd.conf with 86% similarity]
lib/silccrypt/silcrng.c
lib/silcutil/silclog.c

diff --git a/CHANGES b/CHANGES
index 07df78b822819a946946afeb0ad1cbcec79eb8e6..8df7abc40fe487b9723b393ad027ac9d71cde1ce 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+Sun Nov  4 11:43:53 EET 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * Better installation directory handling.  Configure module
+         paths and other paths automatically to example_silc* files
+         in doc/.  A patch by toma.
+
+       * Fixed compiler warning from MPI library, and from SILC RNG.
+         A patch by johnny.
+
 Sat Nov  3 23:48:23 EET 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Find correct make to use in prepare-clean.  A patch by
diff --git a/README b/README
index 2a946e5635c27a7795c85772e50576111ca519b9..78f394db2fc3e5cfe533cc612897368bedfa5ad9 100644 (file)
--- a/README
+++ b/README
@@ -2,12 +2,12 @@ SILC - Secure Internet Live Conferencing
 ========================================
 
 SILC (Secure Internet Live Conferencing) is a protocol which provides
-secure conferencing services in the Internet over insecure channel.
-SILC is IRC like software although internally they are very different.
-Biggest similarity between SILC and IRC is that they both provide
-conferencing services and that SILC has almost same commands as IRC.  Other
-than that they are nothing alike.  Biggest differences are that SILC is 
-secure what IRC is not in any way.  The network model is also entirely
+secure conferencing services on the Internet over insecure channel.
+SILC is IRC-like software although internally they are very different.
+The biggest similarity between SILC and IRC is that they both provide
+conferencing services and that SILC has almost the same commands as IRC.  
+Other than that they are nothing alike.  Major differences are that SILC 
+is secure what IRC is not in any way.  The network model is also entirely
 different compared to IRC.
 
 
index 1f2171177cd759270207e51a198045e389df26fd..dfbd9c9ad63de67a0c2a21af5c8c4ffff56516f8 100644 (file)
@@ -318,8 +318,19 @@ AC_CHECK_HEADERS(dlfcn.h,
 # Default installation destination
 AC_PREFIX_DEFAULT(/usr/local/silc)
 
+if test "x$prefix" != xNONE; then
+       silc_prefix="$prefix"
+else
+       silc_prefix="$ac_default_prefix"
+fi
+
 # etc directory
-ETCDIR="/etc/silc"
+#ETCDIR="/etc/silc"
+if test "x$sysconfdir" != 'x${prefix}/etc'; then
+       ETCDIR="$sysconfdir"
+else
+       ETCDIR="$silc_prefix/etc"
+fi
 AC_ARG_WITH(etcdir,
 [  --with-etcdir[=PATH]    Directory for system files [/etc/silc]],
 [ case "$withval" in
@@ -337,7 +348,8 @@ AC_SUBST(ETCDIR)
 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
 
 # help directory
-HELPDIR="help"
+#HELPDIR="help"
+HELPDIR="$silc_prefix/help"
 AC_ARG_WITH(helpdir,
 [  --with-helpdir[=PATH]   Directory for SILC help files [PREFIX/help]],
 [ case "$withval" in
@@ -355,7 +367,8 @@ AC_SUBST(HELPDIR)
 AC_DEFINE_UNQUOTED(SILC_HELPDIR, "$HELPDIR")
 
 # doc directory
-DOCDIR="doc"
+#DOCDIR="doc"
+DOCDIR="$silc_prefix/doc"
 AC_ARG_WITH(docdir,
 [  --with-docdir[=PATH]    Directory for SILC documentation [PREFIX/doc]],
 [ case "$withval" in
@@ -373,7 +386,8 @@ AC_SUBST(DOCDIR)
 AC_DEFINE_UNQUOTED(SILC_DOCDIR, "$DOCDIR")
 
 # SIM modules directory
-MODULESDIR="modules"
+#MODULESDIR="modules"
+MODULESDIR="$silc_prefix/modules"
 AC_ARG_WITH(simdir,
 [  --with-simdir[=PATH]    Directory for SIM modules [PREFIX/modules]],
 [ case "$withval" in
@@ -391,7 +405,8 @@ AC_SUBST(MODULESDIR)
 AC_DEFINE_UNQUOTED(SILC_MODULESDIR, "$MODULESDIR")
 
 # Logs directory
-LOGSDIR="logs"
+#LOGSDIR="logs"
+LOGSDIR="$silc_prefix/logs"
 AC_ARG_WITH(logsdir,
 [  --with-logsdir[=PATH]   Directory for Server logs [PREFIX/logs]],
 [ case "$withval" in
@@ -718,6 +733,8 @@ lib/silcutil/unix/Makefile
 lib/silcutil/win32/Makefile
 lib/silcsftp/Makefile
 lib/silcsftp/tests/Makefile
+doc/example_silc.conf
+doc/example_silcd.conf
 )     
 
 if test "x$silc_dist" = "xsilc-client" || 
index 438194e56b5be6491029bb152aff61814aff4eb3..3f34557f8d1af6cd0659ae085aef6be2f3603f6e 100644 (file)
@@ -28,7 +28,7 @@ the common naming convention while the lower level routines uses what
 ever they want.  For example, ciphers are implemented currently in this
 way.  They define common SILC Cipher API but the actual implementation
 of algorithms uses their own naming convention.  Another example is
-the GMP math library that uses its own function naming but we have our
+the MPI math library that uses its own function naming but we have our
 own SILC MP API over it that has been defined using common SILC naming
 convention.
 
@@ -270,11 +270,11 @@ be commented.  If nothing more a line of comment telling what the function
 is about helps a lot when you go back to it after six months.  Static
 functions should be commented as well.
 
-The commenting of functions in SILC has been made into the source files,
-and not in the header files where the function prototypes reside.  Header
-files usually includes structure comments, macro comments and perhaps
-some other relevant commenting but usually not function comments.
-It is also Ok to comment the code inside function when it is needed.
+When writing a new header it is preferred that the header file is 
+immediately written in the ROBOdoc documentation format.  This is 
+important when you are doing library code under lib/.  There are plenty
+of examples of this format.  The ROBOdoc is used automatically generate
+the Toolkit documentation.
 
 Comments should use normal C-language comments /* */ and not C++ comments.
 
@@ -342,7 +342,9 @@ Using gotos
 
 Gotos are used in the SILC code quite often.  If you know how to use
 goto's properly then it is ok to use them for example to optimize the
-code.  However, if you don't know how to use goto's do not use them.
+code.  If you use goto's then use them only to make forward jumps, try
+to avoid backward jumps at all cost.  If you don't know how to use goto's 
+do not use them.
 
 
 Debug Messages
@@ -629,7 +631,7 @@ int main()
 Copyrights of the Code
 ======================
 
-The original code in SILC is GPL licensed.  GMP is GPL licensed as well
+The original code in SILC is GPL licensed.  MPI is GPL licensed as well
 and zlib is with free license as well.  New code will be accepted to
 the official SILC source tree if it is coded in GPL or similiar free
 license as GPL is, and of course if it is public domain.  Code with
similarity index 64%
rename from doc/example_silc.conf
rename to doc/example_silc.conf.in
index 968c53f811cc1f124428f5f921b38e442a97134a..0820d9e8ad81b184d92c8b7694ec64d8603ccced 100644 (file)
@@ -6,16 +6,16 @@
 # If the cipher is builtin the <module path> maybe omitted.
 #
 [cipher]
-aes-256-cbc:/usr/local/silc/modules/aes.sim.so:32:16
-aes-192-cbc:/usr/local/silc/modules/aes.sim.so:24:16
-aes-128-cbc:/usr/local/silc/modules/aes.sim.so:16:16
-twofish-256-cbc:/usr/local/silc/modules/twofish.sim.so:32:16
-twofish-192-cbc:/usr/local/silc/modules/twofish.sim.so:24:16
-twofish-128-cbc:/usr/local/silc/modules/twofish.sim.so:16:16
-mars-256-cbc:/usr/local/silc/modules/mars.sim.so:32:16
-mars-192-cbc:/usr/local/silc/modules/mars.sim.so:24:16
-mars-128-cbc:/usr/local/silc/modules/mars.sim.so:16:16
-none:/usr/local/silc/modules/none.sim.so:0:0
+aes-256-cbc:@MODULESDIR@/aes.sim.so:32:16
+aes-192-cbc:@MODULESDIR@/aes.sim.so:24:16
+aes-128-cbc:@MODULESDIR@/aes.sim.so:16:16
+twofish-256-cbc:@MODULESDIR@/twofish.sim.so:32:16
+twofish-192-cbc:@MODULESDIR@/twofish.sim.so:24:16
+twofish-128-cbc:@MODULESDIR@/twofish.sim.so:16:16
+mars-256-cbc:@MODULESDIR@/mars.sim.so:32:16
+mars-192-cbc:@MODULESDIR@/mars.sim.so:24:16
+mars-128-cbc:@MODULESDIR@/mars.sim.so:16:16
+none:@MODULESDIR@/none.sim.so:0:0
 
 #
 # Configured hash functions.
similarity index 86%
rename from doc/example_silcd.conf
rename to doc/example_silcd.conf.in
index aa29aabf4969fe7c099460aa636d22ac7224f0aa..bbd271d01aa482f13038ab963d7149edf055d0cd 100644 (file)
 # If the cipher is builtin the <module path> maybe omitted.
 #
 [Cipher]
-aes-256-cbc:/usr/local/silc/modules/aes.sim.so:32:16
-aes-192-cbc:/usr/local/silc/modules/aes.sim.so:24:16
-aes-128-cbc:/usr/local/silc/modules/aes.sim.so:16:16
-twofish-256-cbc:/usr/local/silc/modules/twofish.sim.so:32:16
-twofish-192-cbc:/usr/local/silc/modules/twofish.sim.so:24:16
-twofish-128-cbc:/usr/local/silc/modules/twofish.sim.so:16:16
-mars-256-cbc:/usr/local/silc/modules/mars.sim.so:32:16
-mars-192-cbc:/usr/local/silc/modules/mars.sim.so:24:16
-mars-128-cbc:/usr/local/silc/modules/mars.sim.so:16:16
-none:/usr/local/silc/modules/none.sim.so:0:0
+aes-256-cbc:@MODULESDIR@/aes.sim.so:32:16
+aes-192-cbc:@MODULESDIR@/aes.sim.so:24:16
+aes-128-cbc:@MODULESDIR@/aes.sim.so:16:16
+twofish-256-cbc:@MODULESDIR@/twofish.sim.so:32:16
+twofish-192-cbc:@MODULESDIR@/twofish.sim.so:24:16
+twofish-128-cbc:@MODULESDIR@/twofish.sim.so:16:16
+mars-256-cbc:@MODULESDIR@/mars.sim.so:32:16
+mars-192-cbc:@MODULESDIR@/mars.sim.so:24:16
+mars-128-cbc:@MODULESDIR@/mars.sim.so:16:16
+none:@MODULESDIR@/none.sim.so:0:0
 
 #
 # Configured hash functions.
@@ -85,7 +85,7 @@ lassi.kuo.fi.ssh.com:10.2.1.6:Kuopio, Finland:706
 # Format: +<public key>:<private key>
 #
 [ServerKeys]
-/etc/silc/silcd.pub:/etc/silc/silcd.prv
+@ETCDIR@/silcd.pub:@ETCDIR@/silcd.prv
 
 #
 # Listenning ports.
@@ -109,10 +109,10 @@ lassi.kuo.fi.ssh.com:10.2.1.6:Kuopio, Finland:706
 #         fatallogile:<path>:<max byte size>
 #
 [Logging]
-infologfile:/usr/local/silc/logs/silcd.log:10000
-#warninglogfile:/usr/local/silc/logs/silcd_warning.log:10000
-#errorlogfile:/usr/local/silc/logs/error.log:10000
-#fatallogfile:/usr/local/silc/logs/silcd_error.log:
+infologfile:@LOGSDIR@/silcd.log:10000
+#warninglogfile:@LOGSDIR@/silcd_warning.log:10000
+#errorlogfile:@LOGSDIR@/error.log:10000
+#fatallogfile:@LOGSDIR@/silcd_error.log:
 
 #
 # Connection classes.
index a52b4eea9efba6cb6b7d7f0fe253918e52aad8c0..3c2dea539a1d6c1dc957f7d5487f689798d53423 100644 (file)
 
 #include "silcincludes.h"
 
+#ifdef HAVE_GETSID
+extern __pid_t getsid (__pid_t __pid);
+#endif
+
+#ifdef HAVE_GETPGID
+extern __pid_t getpgid (__pid_t __pid);
+#endif
+
 #undef SILC_RNG_DEBUG
 /*#define SILC_RNG_DEBUG*/
 
index bb26deceacfd3205ba2f647b9fd8a61aa5daed04..15c64884fec45277afd572fdf4fc32909f6f6070 100644 (file)
@@ -97,8 +97,7 @@ void silc_log_output(const char *filename, uint32 maxsize,
 
   if (!filename)
     fp = stderr;
-
-  if (filename) {
+  else {
     /* Purge the log file if the max size is defined. */
     if (maxsize) {
       fp = fopen(filename, "r");