diff --git a/ChangeLog b/ChangeLog index 507ed171..f735c47d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,24 @@ $Id$ - WARNING!!!!! - This is a testversion for the ICM flag (FSP-1033). This flag - is not yet accepted. It is also possible that certain nodes - are not called anymore!! Please report if so, but only Fidonet - nodes, or if from other nets, show me the nodelist entry too. +v0.61.1 20-Jun-2004. + + general: + Added compile directive for full newsgate. If this switch is + used then mbfido behaves like it did upto version 0.50.0 and + mbnntp is disabled. + + mbfido: + Added compile directive for full newsgate. + + mbnntp: + If compiled in full newsmode, this program acts like a dummy. -v0.61.0 06-Jun-2004. - +v0.61.0 06-Jun-2004 - 20-Jun-2004 libnodelist.a: - Prepared for ICM flag (FSP-1033). + Implemented the ICM flag (FSP-1033). mbmsg: With te post command, the right number of commandline options @@ -26,13 +32,13 @@ v0.61.0 06-Jun-2004. failed. mbout: - Prepared for ICM flag (FSP-1033). + Implemented the ICM flag (FSP-1033). mbcico: - Prepared for ICM flag (FSP-1033). + Implemented the ICM flag (FSP-1033). mbtask: - Prepared for ICM flag (FSP-1033). (Partly). + Implemented the ICM flag (FSP-1033). mbfile: The filenames in the html pages are now the long filenames. diff --git a/configure b/configure index 25583d4b..ee34bcc5 100755 --- a/configure +++ b/configure @@ -3066,11 +3066,14 @@ if test "${enable_newsgate+set}" = set; then else newsgate=no fi; -if test "$newsgate" = "ues"; then +if test "$newsgate" = "yes"; then cat >>confdefs.h <<\_ACEOF #define USE_NEWSGATE 1 _ACEOF + NEWSGATE="Yes" +else + NEWSGATE="No" fi @@ -10189,6 +10192,7 @@ echo "$as_me:$LINENO: result: Version : ..................... ${VERSION} Hydra/Binkp zlib compression : ${ZLIBSUP} + Full newsgate : ............... ${NEWSGATE} " >&5 echo "${ECHO_T} @@ -10198,6 +10202,7 @@ echo "${ECHO_T} Version : ..................... ${VERSION} Hydra/Binkp zlib compression : ${ZLIBSUP} + Full newsgate : ............... ${NEWSGATE} " >&6 diff --git a/configure.in b/configure.in index a86b4c5d..4bbf2fb8 100644 --- a/configure.in +++ b/configure.in @@ -102,8 +102,11 @@ dnl dnl Enable full newsgate, this was default upto 0.50.0 dnl AC_ARG_ENABLE(newsgate, [ --enable-newsgate Compile with newsgate], [ newsgate=$enableval ], [ newsgate=no ]) -if test "$newsgate" = "ues"; then +if test "$newsgate" = "yes"; then AC_DEFINE(USE_NEWSGATE) + NEWSGATE="Yes" +else + NEWSGATE="No" fi @@ -383,6 +386,7 @@ AC_MSG_RESULT([ Version : ..................... ${VERSION} Hydra/Binkp zlib compression : ${ZLIBSUP} + Full newsgate : ............... ${NEWSGATE} ]) diff --git a/mbfido/postecho.c b/mbfido/postecho.c index 0ebdcbc4..fe3e282c 100644 --- a/mbfido/postecho.c +++ b/mbfido/postecho.c @@ -487,10 +487,17 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m } } +#ifdef USE_NEWSGATE + /* + * Gate to newsserver + */ + if (strlen(msgs.Newsgroup) && tonews) { +#else /* * Gate to newsserver if this is a real newsgroup */ if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS) && tonews) { +#endif rewind(nfp); qp = tmpfile(); while ((fgets(buf, MAX_LINE_LENGTH, nfp)) != NULL) { diff --git a/mbfido/scan.c b/mbfido/scan.c index 38e5bac0..a5eb1894 100644 --- a/mbfido/scan.c +++ b/mbfido/scan.c @@ -282,8 +282,12 @@ void ScanFull() if (Link.aka.zone) ExportEcho(Link, Number, &sbl); } +#ifdef USE_NEWSGATE + if (strlen(msgs.Newsgroup)) +#else if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS)) - ExportNews(Number, &sbl); +#endif + ExportNews(Number, &sbl); tidy_falist(&sbl); } @@ -439,8 +443,12 @@ void ScanOne(char *path, unsigned long MsgNum) ExportEcho(Link, MsgNum, &sbl); } } +#ifdef USE_NEWSGATE + if (strlen(msgs.Newsgroup)) +#else if (strlen(msgs.Newsgroup) && (msgs.Type == NEWS)) - ExportNews(MsgNum, &sbl); +#endif + ExportNews(MsgNum, &sbl); tidy_falist(&sbl); } diff --git a/mbfido/scannews.c b/mbfido/scannews.c index 3b491692..59a7022d 100644 --- a/mbfido/scannews.c +++ b/mbfido/scannews.c @@ -205,7 +205,11 @@ void ScanNews(void) while (fread(&Msgs, Msgshdr.recsize, 1, pAreas) == 1) { fseek(pAreas, Msgshdr.syssize, SEEK_CUR); +#ifdef USE_NEWSGATE + if ((Msgs.Active) && strlen(Msgs.Newsgroup)) { +#else if ((Msgs.Active) && strlen(Msgs.Newsgroup) && (Msgs.Type == NEWS)) { +#endif if (IsSema((char *)"upsalarm")) { Syslog('+', "Detected upsalarm semafore, aborting newsscan"); break; diff --git a/mbnntp/atoul.c b/mbnntp/atoul.c index 1ec0c9bc..4f359e97 100644 --- a/mbnntp/atoul.c +++ b/mbnntp/atoul.c @@ -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 diff --git a/mbnntp/atoul.h b/mbnntp/atoul.h index 620979a6..60c33924 100644 --- a/mbnntp/atoul.h +++ b/mbnntp/atoul.h @@ -3,6 +3,10 @@ /* $Id$ */ +#ifndef USE_NEWSGATE + unsigned long atoul(char*); #endif + +#endif diff --git a/mbnntp/auth.c b/mbnntp/auth.c index d976394c..fda3bedc 100644 --- a/mbnntp/auth.c +++ b/mbnntp/auth.c @@ -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 diff --git a/mbnntp/auth.h b/mbnntp/auth.h index a7ab900f..ee569591 100644 --- a/mbnntp/auth.h +++ b/mbnntp/auth.h @@ -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 diff --git a/mbnntp/commands.c b/mbnntp/commands.c index 00713286..233e69ec 100644 --- a/mbnntp/commands.c +++ b/mbnntp/commands.c @@ -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 diff --git a/mbnntp/commands.h b/mbnntp/commands.h index 7d458a16..5919937b 100644 --- a/mbnntp/commands.h +++ b/mbnntp/commands.h @@ -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 diff --git a/mbnntp/hash.c b/mbnntp/hash.c index d25093fa..4ebf10b3 100644 --- a/mbnntp/hash.c +++ b/mbnntp/hash.c @@ -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 diff --git a/mbnntp/hash.h b/mbnntp/hash.h index 511bcdd9..250cbf46 100644 --- a/mbnntp/hash.h +++ b/mbnntp/hash.h @@ -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 diff --git a/mbnntp/lhash.c b/mbnntp/lhash.c index 9b4886f1..7f7b7c20 100644 --- a/mbnntp/lhash.c +++ b/mbnntp/lhash.c @@ -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 diff --git a/mbnntp/lhash.h b/mbnntp/lhash.h index d7071c47..f74e1890 100644 --- a/mbnntp/lhash.h +++ b/mbnntp/lhash.h @@ -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 diff --git a/mbnntp/mbnntp.c b/mbnntp/mbnntp.c index 977039ef..0c9e3909 100644 --- a/mbnntp/mbnntp.c +++ b/mbnntp/mbnntp.c @@ -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 diff --git a/mbnntp/mbnntp.h b/mbnntp/mbnntp.h index 3396fe80..f44fd7ba 100644 --- a/mbnntp/mbnntp.h +++ b/mbnntp/mbnntp.h @@ -4,7 +4,12 @@ /* $Id$ */ void send_nntp(const char *, ...); + +#ifndef USE_NEWSGATE + int get_nntp(char *, int); void nntp(void); #endif + +#endif diff --git a/mbnntp/mkftnhdr.c b/mbnntp/mkftnhdr.c index f2c96422..2f0e31c4 100644 --- a/mbnntp/mkftnhdr.c +++ b/mbnntp/mkftnhdr.c @@ -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 diff --git a/mbnntp/mkftnhdr.h b/mbnntp/mkftnhdr.h index 428473f7..47e1ad7d 100644 --- a/mbnntp/mkftnhdr.h +++ b/mbnntp/mkftnhdr.h @@ -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 diff --git a/mbnntp/msgflags.c b/mbnntp/msgflags.c index a2e0228f..e2498eee 100644 --- a/mbnntp/msgflags.c +++ b/mbnntp/msgflags.c @@ -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 diff --git a/mbnntp/msgflags.h b/mbnntp/msgflags.h index c5eeac94..09972e2c 100644 --- a/mbnntp/msgflags.h +++ b/mbnntp/msgflags.h @@ -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 diff --git a/mbnntp/openport.h b/mbnntp/openport.h index 798bbba9..6ecce1d0 100644 --- a/mbnntp/openport.h +++ b/mbnntp/openport.h @@ -6,5 +6,4 @@ int rawport(void); int cookedport(void); - #endif diff --git a/mbnntp/rfc2ftn.c b/mbnntp/rfc2ftn.c index 098d8c55..094366d7 100644 --- a/mbnntp/rfc2ftn.c +++ b/mbnntp/rfc2ftn.c @@ -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 diff --git a/mbnntp/rfc2ftn.h b/mbnntp/rfc2ftn.h index b5bd6ed6..76f5e924 100644 --- a/mbnntp/rfc2ftn.h +++ b/mbnntp/rfc2ftn.h @@ -3,6 +3,10 @@ /* $Id$ */ +#ifndef USE_NEWSGATE + int rfc2ftn(FILE *fp); #endif + +#endif