From f7b04b59125cf9355b9f62fd768c41f9e9fb2376 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 4 Nov 2001 09:53:35 +0000 Subject: [PATCH] updates. --- CHANGES | 9 ++++++ README | 12 ++++---- configure.in.pre | 27 +++++++++++++---- doc/CodingStyle | 18 ++++++----- ...example_silc.conf => example_silc.conf.in} | 20 ++++++------- ...ample_silcd.conf => example_silcd.conf.in} | 30 +++++++++---------- lib/silccrypt/silcrng.c | 8 +++++ lib/silcutil/silclog.c | 3 +- 8 files changed, 81 insertions(+), 46 deletions(-) rename doc/{example_silc.conf => example_silc.conf.in} (64%) rename doc/{example_silcd.conf => example_silcd.conf.in} (86%) diff --git a/CHANGES b/CHANGES index 07df78b8..8df7abc4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +Sun Nov 4 11:43:53 EET 2001 Pekka Riikonen + + * 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 * Find correct make to use in prepare-clean. A patch by diff --git a/README b/README index 2a946e56..78f394db 100644 --- 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. diff --git a/configure.in.pre b/configure.in.pre index 1f217117..dfbd9c9a 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -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" || diff --git a/doc/CodingStyle b/doc/CodingStyle index 438194e5..3f34557f 100644 --- a/doc/CodingStyle +++ b/doc/CodingStyle @@ -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 diff --git a/doc/example_silc.conf b/doc/example_silc.conf.in similarity index 64% rename from doc/example_silc.conf rename to doc/example_silc.conf.in index 968c53f8..0820d9e8 100644 --- a/doc/example_silc.conf +++ b/doc/example_silc.conf.in @@ -6,16 +6,16 @@ # If the cipher is builtin the 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. diff --git a/doc/example_silcd.conf b/doc/example_silcd.conf.in similarity index 86% rename from doc/example_silcd.conf rename to doc/example_silcd.conf.in index aa29aabf..bbd271d0 100644 --- a/doc/example_silcd.conf +++ b/doc/example_silcd.conf.in @@ -12,16 +12,16 @@ # If the cipher is builtin the 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: +: # [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:: # [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. diff --git a/lib/silccrypt/silcrng.c b/lib/silccrypt/silcrng.c index a52b4eea..3c2dea53 100644 --- a/lib/silccrypt/silcrng.c +++ b/lib/silccrypt/silcrng.c @@ -28,6 +28,14 @@ #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*/ diff --git a/lib/silcutil/silclog.c b/lib/silcutil/silclog.c index bb26dece..15c64884 100644 --- a/lib/silcutil/silclog.c +++ b/lib/silcutil/silclog.c @@ -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"); -- 2.24.0