$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
/* ************************************************************************** */
-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
}
-inline void CtdlIPC_unlock(CtdlIPC *ipc)
+INLINE void CtdlIPC_unlock(CtdlIPC *ipc)
{
#ifdef THREADED_CLIENT
pthread_mutex_unlock(&(ipc->mutex));
#define DEFAULT_PORT "citadel"
#include "sysdep.h"
+#include "server.h"
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif
/* 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,
* 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);
}
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++)
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;
}
}
}
}
- // 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 */
#define SERVER_H
#ifdef __GNUC__
-#define INLINE inline
+#define INLINE __inline__
#else
#define INLINE
#endif
*
* 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)
* (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));
}
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);
* 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);