did a minimal amount of ANSIfication without changing anything that would
authorNathan Bryant <loanshark@uncensored.citadel.org>
Tue, 9 Dec 2003 06:39:20 +0000 (06:39 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Tue, 9 Dec 2003 06:39:20 +0000 (06:39 +0000)
affect the compiler output in any way. I was just trying to get enough warnings
enabled to be able to tell if there are any nested functions lurking about...

If we get rid of nested functions we can get some big security gains under
Fedora.

citadel/ChangeLog
citadel/citadel_ipc.c
citadel/citadel_ipc.h
citadel/clientsocket.c
citadel/md5.c
citadel/messages.c
citadel/server.h
citadel/sysdep.c
citadel/sysdep_decls.h
citadel/user_ops.c

index e62e3e49ae2dd9f620db6f54825029128dd6eb5c..2db9fe2de5c60914c5f7aeabd2253dbfd15800fb 100644 (file)
@@ -1,4 +1,12 @@
  $Log$
+ Revision 612.9  2003/12/09 06:39:19  nbryant
+ did a minimal amount of ANSIfication without changing anything that would
+ affect the compiler output in any way. I was just trying to get enough warnings
+ enabled to be able to tell if there are any nested functions lurking about...
+
+ If we get rid of nested functions we can get some big security gains under
+ Fedora.
+
  Revision 612.8  2003/12/09 05:12:49  ajc
  * Don't give away anonymous poster information in IMAP or RFC822
 
@@ -5131,4 +5139,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 16e7ecbde02219752e5f3518c37ac24723e94b45..c960c1d5ffb65035aa25ff245da44a938e978ec4 100644 (file)
@@ -2004,7 +2004,7 @@ int CtdlIPCMessageBaseCheck(CtdlIPC *ipc, char **mret, char *cret)
 /* ************************************************************************** */
 
 
-inline void CtdlIPC_lock(CtdlIPC *ipc)
+INLINE void CtdlIPC_lock(CtdlIPC *ipc)
 {
        if (ipc->network_status_cb) ipc->network_status_cb(1);
 #ifdef THREADED_CLIENT
@@ -2013,7 +2013,7 @@ inline void CtdlIPC_lock(CtdlIPC *ipc)
 }
 
 
-inline void CtdlIPC_unlock(CtdlIPC *ipc)
+INLINE void CtdlIPC_unlock(CtdlIPC *ipc)
 {
 #ifdef THREADED_CLIENT
        pthread_mutex_unlock(&(ipc->mutex));
index bbda4ff8742da15ef4ee1c0970dbb57b5b2b9054..4ab3b1a4db0908757b23c1c5936fb9d975832fe4 100644 (file)
@@ -9,6 +9,7 @@
 #define DEFAULT_PORT           "citadel"
 
 #include "sysdep.h"
+#include "server.h"
 #ifdef HAVE_PTHREAD_H
 #include <pthread.h>
 #endif
@@ -292,8 +293,8 @@ int CtdlIPCMessageBaseCheck(CtdlIPC *ipc, char **mret, char *cret);
 /*             Stuff below this line is not for public consumption            */
 /* ************************************************************************** */
 
-inline void CtdlIPC_lock(CtdlIPC *ipc);
-inline void CtdlIPC_unlock(CtdlIPC *ipc);
+INLINE void CtdlIPC_lock(CtdlIPC *ipc);
+INLINE void CtdlIPC_unlock(CtdlIPC *ipc);
 char *CtdlIPCReadListing(CtdlIPC *ipc, char *dest);
 int CtdlIPCSendListing(CtdlIPC *ipc, const char *listing);
 size_t CtdlIPCPartialRead(CtdlIPC *ipc, void **buf, size_t offset,
index c6b7bbdd97aa22e22a7f03d95ca13d22dd591116..83e915cb281a212089042eae5df15e2270e30110 100644 (file)
@@ -137,7 +137,7 @@ int sock_read_to(int sock, char *buf, int bytes, int timeout)
  * sock_read() - input binary data from socket.
  * Returns the number of bytes read, or -1 for error.
  */
-inline int sock_read(int sock, char *buf, int bytes)
+INLINE int sock_read(int sock, char *buf, int bytes)
 {
        return sock_read_to(sock, buf, bytes, CLIENT_TIMEOUT);
 }
index 92196d377212af15765611b9f46e203acdc0e891..2e600d363ac1eb4dfadc6780dfd6879af17c4b64 100644 (file)
@@ -343,9 +343,9 @@ char *make_apop_string(char *realpass, char *nonce, char *buffer, size_t n)
    int i;
    
    MD5Init(&ctx);
-//   scr_printf("MD5@@: Adding nonce: %s\n", nonce);
+/*   scr_printf("MD5@@: Adding nonce: %s\n", nonce); */
    MD5Update(&ctx, (u_char*)nonce, strlen(nonce));
-//   scr_printf("MD5@@: Adding password %s\n", realpass);
+/*   scr_printf("MD5@@: Adding password %s\n", realpass); */
    MD5Update(&ctx, (u_char*)realpass, strlen(realpass));
    MD5Final(rawdigest, &ctx);
    for (i=0; i<MD5_DIGEST_LEN; i++)
@@ -354,7 +354,7 @@ char *make_apop_string(char *realpass, char *nonce, char *buffer, size_t n)
       buffer[i*2] = tolower(buffer[i*2]);
       buffer[(i*2)+1] = tolower(buffer[(i*2)+1]);
    }
-//   scr_printf("MD5@@: Result is %s\n", buffer);
+/*   scr_printf("MD5@@: Result is %s\n", buffer); */
    return buffer;
 }
 
index 24b051464c9802cee62ff94a425544d4840d7df8..2a814678ceb877d2e17ed78650865d144bd68ea4 100644 (file)
@@ -1653,7 +1653,7 @@ RMSGREAD: scr_flush();
                           }
                          }
                  }
-                   // we are now in synch with the server
+                   /* we are now in synch with the server */
                 if (founda)
                   break; /* for */
                 lasta = finda; /* keep one behind or we skip on the reentrance to the for */
index b83a8079a3e881d59efd300206094bfd55e03b73..0886d8e94c4b0af6a4ed035735b5e03c2a9e4b60 100644 (file)
@@ -10,7 +10,7 @@
 #define SERVER_H
 
 #ifdef __GNUC__
-#define INLINE inline
+#define INLINE __inline__
 #else
 #define INLINE
 #endif
index 9ec508e087021882395e0b09ecb894e5d02796f9..0eba07f384a777a8419752189bf903cbf76846d0 100644 (file)
@@ -411,7 +411,7 @@ int ig_uds_server(char *sockpath, int queue_len)
  *
  * It's inlined because it's used *VERY* frequently.
  */
-inline struct CitContext *MyContext(void) {
+INLINE struct CitContext *MyContext(void) {
        return ((pthread_getspecific(MyConKey) == NULL)
                ? &masterCC
                : (struct CitContext *) pthread_getspecific(MyConKey)
@@ -633,7 +633,7 @@ int client_read_to(char *buf, int bytes, int timeout)
  * (This is implemented in terms of client_read_to() and could be
  * justifiably moved out of sysdep.c)
  */
-inline int client_read(char *buf, int bytes)
+INLINE int client_read(char *buf, int bytes)
 {
        return(client_read_to(buf, bytes, config.c_sleeping));
 }
index c7870e63e55e39d16658406c498d0f92aa1ed943..9b7483ed8d771afb2eeddb6c2b5d7ccecaeaf664 100644 (file)
@@ -17,7 +17,7 @@ void begin_critical_section (int which_one);
 void end_critical_section (int which_one);
 int ig_tcp_server (int port_number, int queue_len);
 int ig_uds_server(char *sockpath, int queue_len);
-inline struct CitContext *MyContext (void);
+INLINE struct CitContext *MyContext (void);
 struct CitContext *CreateNewContext (void);
 void InitMyContext (struct CitContext *con);
 void buffer_output(void);
index c72b0ff7195b6f5b3e99a3ace2360903c99958f0..0a3ff2e8c6be5fadd1500773ecc79a58d5a64b35 100644 (file)
@@ -58,7 +58,7 @@
  * makeuserkey() - convert a username into the format used as a database key
  *                 (it's just the username converted into lower case)
  */
-static inline void makeuserkey(char *key, char *username) {
+static INLINE void makeuserkey(char *key, char *username) {
        int i, len;
 
        len = strlen(username);