Added full newsgroup compile switch
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
#include "atoul.h"
|
||||
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
unsigned long atoul(char *str)
|
||||
{
|
||||
unsigned long x;
|
||||
@@ -43,3 +45,4 @@ unsigned long atoul(char *str)
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -3,6 +3,10 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
unsigned long atoul(char*);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "mbnntp.h"
|
||||
#include "auth.h"
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
int authorized = FALSE; /* Authentication status */
|
||||
int got_username = FALSE; /* Did we get a username? */
|
||||
@@ -168,4 +169,4 @@ void auth_pass(char *cmd)
|
||||
send_nntp("281 Authentication accepted");
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -3,8 +3,12 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
int check_auth(char *); /* Check user is authorized */
|
||||
void auth_user(char *); /* Auth username */
|
||||
void auth_pass(char *); /* Auth password */
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "commands.h"
|
||||
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
unsigned long article = 0L; /* Current article */
|
||||
char currentgroup[81]; /* Current newsgroup */
|
||||
@@ -595,4 +596,4 @@ void command_xover(char *cmd)
|
||||
send_nntp(".");
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -3,6 +3,8 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
void command_abhs(char *); /* ARTICLE/BODY/HEADER/STAT */
|
||||
void command_group(char *); /* GROUP */
|
||||
void command_list(char *); /* LIST */
|
||||
@@ -10,3 +12,5 @@ void command_post(char *); /* POST */
|
||||
void command_xover(char *); /* XOVER */
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "hash.h"
|
||||
#include "lhash.h"
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
void hash_update_s(unsigned long *id, char *mod)
|
||||
{
|
||||
@@ -50,3 +51,4 @@ void hash_update_n(unsigned long *id, unsigned long mod)
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,8 +1,13 @@
|
||||
#ifndef HASH_H
|
||||
#define HASH_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
void hash_update_s(unsigned long *, char *);
|
||||
void hash_update_n(unsigned long *, unsigned long);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#include "../lib/mbselib.h"
|
||||
#include "lhash.h"
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
/* crypto/lhash/lhash.c */
|
||||
/* Copyright (C) 1995-1996 Eric Young (eay@mincom.oz.au)
|
||||
* All rights reserved.
|
||||
@@ -498,3 +500,4 @@ unsigned long lh_strhash(char *c)
|
||||
return((ret>>16)^ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -52,6 +52,8 @@
|
||||
#ifndef HEADER_LHASH_H
|
||||
#define HEADER_LHASH_H
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -145,3 +147,5 @@ void lh_node_usage_stats_bio();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -76,10 +76,14 @@ void die(int onsig)
|
||||
free(envptr);
|
||||
|
||||
ExitClient(onsig);
|
||||
|
||||
msleep(1); /* For the linker only */
|
||||
colour(0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
/*
|
||||
* Check if the system is available.
|
||||
*/
|
||||
@@ -96,6 +100,7 @@ int check_free(void)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -135,6 +140,10 @@ int main(int argc, char *argv[])
|
||||
Syslog(' ', "MBNNTP v%s", VERSION);
|
||||
IsDoing("Loging in");
|
||||
|
||||
#ifdef USE_NEWSGATE
|
||||
WriteError("MBSEBBS is compiled for full newsgate, you cannot use mbnntp!");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Catch all the signals we can, and ignore the rest.
|
||||
*/
|
||||
@@ -155,12 +164,16 @@ int main(int argc, char *argv[])
|
||||
Syslog('s', "TCP connection: len=%d, family=%hd, port=%hu, addr=%s",
|
||||
addrlen,peeraddr.sin_family, peeraddr.sin_port, inet_ntoa(peeraddr.sin_addr));
|
||||
Syslog('+', "Incoming connection from %s", inet_ntoa(peeraddr.sin_addr));
|
||||
#ifdef USE_NEWSGATE
|
||||
send_nntp("400 Server closed");
|
||||
#else
|
||||
if (! check_free()) {
|
||||
send_nntp("400 Server closed");
|
||||
} else {
|
||||
send_nntp("200 MBNNTP v%s server ready -- posting allowed", VERSION);
|
||||
nntp();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +185,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
/*
|
||||
* Get command from the client.
|
||||
* return < 0: error
|
||||
@@ -212,6 +226,7 @@ int get_nntp(char *buf, int max)
|
||||
|
||||
return 0; /* Not reached */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -236,6 +251,7 @@ void send_nntp(const char *format, ...)
|
||||
|
||||
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
void nntp(void)
|
||||
{
|
||||
char buf[4096];
|
||||
@@ -335,4 +351,4 @@ void nntp(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -4,7 +4,12 @@
|
||||
/* $Id$ */
|
||||
|
||||
void send_nntp(const char *, ...);
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
int get_nntp(char *, int);
|
||||
void nntp(void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -48,10 +48,9 @@
|
||||
#include "atoul.h"
|
||||
#include "hash.h"
|
||||
#include "msgflags.h"
|
||||
//#include "aliasdb.h"
|
||||
#include "mkftnhdr.h"
|
||||
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
#ifndef ULONG_MAX
|
||||
#define ULONG_MAX 4294967295
|
||||
@@ -591,4 +590,4 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int newsmode, faddr *recipient)
|
||||
return tmsg;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -1,10 +1,13 @@
|
||||
#ifndef _MKFTNHDR_H
|
||||
#define _MKFTNHDR_H
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
int ftnmsgid(char *,char **,unsigned long *,char *);
|
||||
ftnmsg *mkftnhdr(rfcmsg *, int, faddr *);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "../lib/mbselib.h"
|
||||
#include "msgflags.h"
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
static char *flnm[] = {
|
||||
(char *)"PVT",(char *)"CRS",(char *)"RCV",(char *)"SNT",
|
||||
@@ -130,4 +131,4 @@ int flag_on(char *flag, char *flags)
|
||||
return up;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -3,6 +3,8 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
int flag_on(char *,char *);
|
||||
int flagset(char *);
|
||||
char *compose_flags(int,char *);
|
||||
@@ -11,3 +13,4 @@ int flag_on(char *,char *);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -6,5 +6,4 @@
|
||||
int rawport(void);
|
||||
int cookedport(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include "msgflags.h"
|
||||
#include "rfc2ftn.h"
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
#define MAXHDRSIZE 2048
|
||||
#define MAXSEEN 70
|
||||
@@ -841,4 +842,4 @@ int needputrfc(rfcmsg *msg, int newsmode)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -3,6 +3,10 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef USE_NEWSGATE
|
||||
|
||||
int rfc2ftn(FILE *fp);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user