Release 0.95.11, patches by Scott Street. Netmail nodelist sysop lookup added and some fixes

This commit is contained in:
Michiel Broek 2011-01-26 23:37:48 +01:00
parent 19a0ee7bd9
commit 6c577239f6
22 changed files with 201 additions and 48 deletions

View File

@ -1,3 +1,20 @@
v0.95.11 14-Jan-2011 (patches by Scott Street).
mbselib:
Fixed memory corruption error in mbnntp.
Added sysop in nodelist search function.
mbsebbs:
Fixed several (possible) buffer overflows, some serious ones.
Added lookup sysop in nodelist for netmail messages.
mbtask:
Fixed several (possible) buffer overflows.
lang:
Added language prompts 480 and 481.
v0.95.10 26-Aug-2010 (released by Vince Coen).
mbsetup:

6
configure vendored
View File

@ -2274,10 +2274,10 @@ SUBDIRS="lib mbcico mbfido mbmon mbsebbs mbutils mbnntp mbtask mbsetup unix lang
PACKAGE="mbsebbs"
MAJOR="0"
MINOR="95"
REVISION="10"
REVISION="11"
VERSION="$MAJOR.$MINOR.$REVISION"
COPYRIGHT="Copyright (C) 1997-2010 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2010 M. Broek"
COPYRIGHT="Copyright (C) 1997-2011 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2011 M. Broek"
GROUP="bbs"
OWNER="mbse"
ROWNER="`id -un root`"

View File

@ -12,10 +12,10 @@ AC_SUBST(SUBDIRS)
PACKAGE="mbsebbs"
MAJOR="0"
MINOR="95"
REVISION="10"
REVISION="11"
VERSION="$MAJOR.$MINOR.$REVISION"
COPYRIGHT="Copyright (C) 1997-2010 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2010 M. Broek"
COPYRIGHT="Copyright (C) 1997-2011 Michiel Broek, All Rights Reserved"
SHORTRIGHT="Copyright (C) 1997-2011 M. Broek"
GROUP="bbs"
OWNER="mbse"
ROWNER="`id -un root`"

View File

@ -478,3 +478,5 @@
477 mail.c |Use your alias (
478 mail.c YN|) to post this message [Y/n]:
479 mail.c |No more areas with unread messages
480 mail.c |Addresse not in Nodelist
481 mail.c |Found Addresse in Nodelist

View File

@ -478,3 +478,5 @@ JN|Datei anhaengen [j/N]:
|Moechten Sie Ihren Aliasnamen (
JN|) als Absender verwenden [J/n]
|Keine weitere Bereiche mit ungelesenen Nachrichten
|Addresse not in Nodelist
|Found Addresse in Nodelist

View File

@ -478,3 +478,5 @@ YN|Attach file [y/N]:
|Use your alias (
YN|) to post this message [Y/n]:
|No more areas with unread messages
|Addresse not in Nodelist
|Found Addresse in Nodelist

View File

@ -478,3 +478,5 @@ YN|Adjuntar fichero [s/N]:
|Usar tu alias (
SN|) para este mensaje [S/n]:
|No hay mas areas con mensajes no leidos
|Addresse not in Nodelist
|Found Addresse in Nodelist

View File

@ -478,3 +478,5 @@ YN|Attach file [y/N]:
|Use your alias (
YN|) to post this message [Y/n]:
|No more areas with unread messages
|Addresse not in Nodelist
|Found Addresse in Nodelist

View File

@ -478,3 +478,5 @@ YN|Adxuntar ficheiro [s/N]:
|¨Queres usa-lo alias (
SN|) nesta mensaxe? [S/n]:
|Non hai mais  reas con mensaxes sen ler.
|Addresse not in Nodelist
|Found Addresse in Nodelist

View File

@ -478,3 +478,5 @@ JN|Bestand meesturen [j/N]:
|Use your alias (
YN|) to post this message [Y/n]:
|Geen gebieden meer met ongelezen berichten
|Geadresseerde niet in de Nodelijst
|Geadresseerde gevonden in de nodelijst

View File

@ -478,3 +478,5 @@ YN|Attach file [y/N]:
|Use your alias (
YN|) to post this message [Y/n]:
|No more areas with unread messages
|Addresse not in Nodelist
|Found Addresse in Nodelist

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: nntp.c,v 1.16 2008/12/28 12:20:14 mbse Exp $
* Purpose ...............: MBSE BBS Internet Library
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -249,7 +248,7 @@ int nntp_cmd(char *cmd, int resp)
if (strncmp(p, rsp, strlen(rsp))) {
WriteError("NNTP> %s", cmd);
WriteError("NNTP< %s", p);
memset(&resp, 0, sizeof(rsp));
memset(rsp, 0, sizeof(rsp));
strncpy(rsp, p, 3);
return atoi(rsp);
}

View File

@ -1162,3 +1162,89 @@ retdummy:
}
node_list *searchSysop( char *SysopName )
{
char nodeuserpath[256];
FILE *fp;
char fixedSysopName[36];
nlusr nluEntry;
faddr addr;
node_list *result;
node *nlEntry;
Syslog('n', "searchSysop: Arg(%s) started", SysopName );
result = NULL;
snprintf(nodeuserpath, 256, "%s/%s", CFG.nodelists, "node.users");
if ((fp = fopen(nodeuserpath, "r")) == NULL) {
WriteError("$Can't open %s", nodeuserpath);
return NULL;
}
/*
* fixup incoming sysop name to have _ for space
*/
memset( fixedSysopName, 0, 36 );
int i;
for ( i=0; i<strlen( SysopName ); i++ ){
if ( SysopName[i] == ' ' ){
fixedSysopName[i] = '_';
} else {
fixedSysopName[i] = SysopName[i];
}
}
while (fread(&nluEntry, sizeof(nluEntry), 1, fp) == 1) {
if ( strcmp( fixedSysopName, nluEntry.user ) == 0 ){
addr.zone = nluEntry.zone;
addr.net = nluEntry.net;
addr.node = nluEntry.node;
addr.point = nluEntry.point;
addr.name = fixedSysopName;
addr.domain = NULL;
nlEntry = getnlent( &addr );
if ( NULL == nlEntry ) {
/* yikes */
Syslog('n',"searchSysop: Something terribly wrong happened with getnlent looking up (%d:%d/%d.%d)",
addr.zone, addr.net, addr.node, addr.point );
return NULL;
}
Syslog('n',"searchSysop: found NL Entry: Name:(%s) @ (%s)", nlEntry->name, nlEntry->location);
node_list *thisresult = result;
if (thisresult == NULL) {
result = malloc( sizeof(node_list));
result->next = NULL;
thisresult = result;
} else {
while ( thisresult->next != NULL ){
thisresult = thisresult->next;
}
thisresult->next = malloc( sizeof(node_list));
thisresult = thisresult->next;
thisresult->next = NULL;
}
thisresult->addr.zone = nlEntry->addr.zone;
thisresult->addr.net = nlEntry->addr.net;
thisresult->addr.node = nlEntry->addr.node;
thisresult->addr.point = nlEntry->addr.point;
strcpy( thisresult->Sysop, nlEntry->sysop );
strcpy( thisresult->Location, nlEntry->location);
strcpy( thisresult->Name, nlEntry->name );
}
if ( nluEntry.user[0] > fixedSysopName[0] ) { // Since list is sorted, abort once we get names that start after this one
break;
}
}
fclose( fp );
Syslog('n', "searchSysop: Arg(%s) ended", SysopName );
return result;
}

View File

@ -41,6 +41,16 @@ typedef struct _node {
typedef struct _node_list {
struct _node_list *next;
faddr addr;
char Name[80];
char Sysop[80];
char Location[80];
} node_list;
/*
* Memory array structures read from nodelist.conf
*/
@ -122,7 +132,7 @@ nodelist_service *nl_service;
int initnl(void);
void deinitnl(void);
node *getnlent(faddr *);
node_list *searchSysop(char *);
#endif

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: dispfile.c,v 1.26 2007/09/02 15:04:36 mbse Exp $
* Purpose ...............: Display ANSI/ASCII textfiles
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -314,7 +313,7 @@ int DisplayFile(char *filename)
break;
default: snprintf(tmp1, sizeof(tmp1)-1, "%c", buf[x]);
strncat(out, tmp1, sizeof(out));
strncat(out, tmp1, sizeof(out)-1);
} /* switch */
} /* for */

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: email.c,v 1.35 2008/02/12 19:59:45 mbse Exp $
* Purpose ...............: Internet email
*
*****************************************************************************
* Copyright (C) 1997-2008
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -438,7 +437,7 @@ int Read_a_Email(unsigned int Num)
* a reply will be made.
*/
if (strncasecmp(p, "\001Message-id: ", 13) == 0) {
snprintf(Msg.Msgid, 101, "%s", p+13);
snprintf(Msg.Msgid, sizeof(Msg.Msgid), "%s", p+13);
Syslog('m', "Stored Msgid \"%s\"", Msg.Msgid);
}
if (Kludges) {
@ -747,9 +746,9 @@ void Reply_Email(int IsReply)
Line = 1;
Msg_New();
snprintf(Msg.Replyid, 101, "%s", msgid);
snprintf(Msg.ReplyTo, 101, "%s", replyto);
snprintf(Msg.ReplyAddr, 101, "%s", replyaddr);
snprintf(Msg.Replyid, sizeof(Msg.Replyid), "%s", msgid);
snprintf(Msg.ReplyTo, sizeof(Msg.ReplyTo), "%s", replyto);
snprintf(Msg.ReplyAddr, sizeof(Msg.ReplyAddr), "%s", replyaddr);
/* From : */
pout(YELLOW, BLACK, (char *) Language(209));

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: fsedit.c,v 1.28 2007/08/25 18:32:08 mbse Exp $
* Purpose ...............: FullScreen Message editor.
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -395,8 +394,11 @@ int FsWordWrap()
if ((WCol == 80) && (Col >= WCol))
WCol = strlen((char *)tmpLine)+1;
else {
if (tmpLine[strlen((char *)tmpLine)] != ' ')
snprintf((char *)tmpLine + strlen((char *)tmpLine), 1, " ");
if (tmpLine[strlen((char *)tmpLine)] != ' '){
int tmpLength=strlen((char *)tmpLine);
tmpLine[tmpLength] = ' ';
tmpLine[tmpLength+1] = '\0';
}
WCol = strlen((char *)tmpLine);
}
snprintf(Message[CurRow+1], TEXTBUFSIZE +1, "%s", strcat((char *)tmpLine, Message[CurRow+1]));

View File

@ -1,11 +1,10 @@
/*****************************************************************************
*
* $Id: mail.c,v 1.69 2008/02/12 19:59:45 mbse Exp $
* Purpose ...............: Message reading and writing.
* Todo ..................: Implement message groups.
*
*****************************************************************************
* Copyright (C) 1997-2008
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -503,8 +502,38 @@ void Post_Msg()
} else if (msgs.Type == NETMAIL) {
x = FALSE;
Enter(1);
pout(YELLOW, BLACK, (char *)"Address : ");
FidoNode = calloc(61, sizeof(char));
/*
* Search for Name in Sysop Index of Nodelist
*/
node_list *nodesSysop;
node_list *thisNode;
node_list *prevNode;
if ( NULL ==( nodesSysop=searchSysop(Msg.To) )){
snprintf(msg, 81, "%s\r\n\n", (char*)Language(480));
pout(RED, BLACK, msg);
} else {
snprintf(msg, 81, "%s\r\n\n", (char*)Language(481));
pout(GREEN, BLACK, msg);
thisNode = nodesSysop;
while ( thisNode != NULL ){
snprintf(msg, 81, "(%d:%d/%d:%d) %s @ %s\r\n",
thisNode->addr.zone, thisNode->addr.net,
thisNode->addr.node, thisNode->addr.point,
thisNode->Name, thisNode->Location);
pout(CYAN, BLACK, msg);
prevNode = thisNode;
thisNode = thisNode->next;
free( prevNode );
}
pout(YELLOW, BLACK, (char *)"\r\n");
}
/*
* End Search
*/
pout(YELLOW, BLACK, (char *)"Address : ");
colour(CFG.MsgInputColourF, CFG.MsgInputColourB);
GetstrC(FidoNode, 60);
@ -1610,9 +1639,9 @@ void Reply_Msg(int IsReply)
Message[i] = (char *) calloc(MAX_LINE_LENGTH +1, sizeof(char));
Msg_New();
strncpy(Msg.Replyid, msgid, 101);
strncpy(Msg.ReplyTo, replyto, 101);
strncpy(Msg.ReplyAddr, replyaddr, 101);
strncpy(Msg.Replyid, msgid, sizeof(Msg.Replyid));
strncpy(Msg.ReplyTo, replyto, sizeof(Msg.ReplyTo));
strncpy(Msg.ReplyAddr, replyaddr, sizeof(Msg.ReplyAddr));
/* From : */
if (Alias_Option()) {

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: msgutil.c,v 1.24 2005/10/11 20:49:48 mbse Exp $
* Purpose ...............: Utilities for message handling.
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -160,7 +159,7 @@ void Add_Headkludges(faddr *dest, int IsReply)
time_t tt;
faddr *Node;
temp = calloc(128, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
switch (msgs.Type) {
case LOCALMAIL: Msg.Localmail = TRUE;

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: oneline.c,v 1.15 2007/02/26 14:48:23 mbse Exp $
* Purpose ...............: Oneliner functions.
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -196,7 +195,7 @@ char *Oneliner_Get()
/*
* Get a random oneliner
*/
sFileName = calloc(128, sizeof(char));
sFileName = calloc(PATH_MAX, sizeof(char));
snprintf(sFileName, PATH_MAX, "%s/etc/oneline.data", getenv("MBSE_ROOT"));
if ((pOneline = fopen(sFileName, "r+")) == NULL) {

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: m_lang.c,v 1.25 2007/02/17 12:14:27 mbse Exp $
* Purpose ...............: Setup Languages.
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -126,7 +125,7 @@ void UpgradeLanguage(char *name, char *lc)
WriteError("$Can't move %s to %s", lang.xMenuPath, temp);
} else {
Syslog('+', "Moved %s to %s", lang.xMenuPath, temp);
snprintf(lang.xMenuPath, PATH_MAX, temp);
snprintf(lang.xMenuPath, sizeof(lang.xMenuPath), temp);
}
} else {
Syslog('+', "%s already upgraded", temp);
@ -140,7 +139,7 @@ void UpgradeLanguage(char *name, char *lc)
WriteError("$Can't move %s to %s", lang.xTextPath, temp);
} else {
Syslog('+', "Moved %s to %s", lang.xTextPath, temp);
snprintf(lang.xTextPath, PATH_MAX, temp);
snprintf(lang.xTextPath, sizeof(lang.xTextPath), temp);
}
} else {
Syslog('+', "%s already upgraded", temp);
@ -154,7 +153,7 @@ void UpgradeLanguage(char *name, char *lc)
WriteError("$Can't move %s to %s", lang.xMacroPath, temp);
} else {
Syslog('+', "Moved %s to %s", lang.xMacroPath, temp);
snprintf(lang.xMacroPath, PATH_MAX, temp);
snprintf(lang.xMacroPath, sizeof(lang.xMacroPath), temp);
}
} else {
Syslog('+', "%s already upgraded", temp);

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: taskchat.c,v 1.63 2006/05/27 13:19:53 mbse Exp $
* Purpose ...............: mbtask - chat server
*
*****************************************************************************
* Copyright (C) 1997-2006
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -455,23 +454,23 @@ void chat_connect_r(char *data, char *buf)
* Now put welcome message into the ringbuffer and report success.
*/
temp = calloc(81, sizeof(char));
snprintf(temp, 200, "MBSE BBS v%s chat server; type /help for help", VERSION);
snprintf(temp, 80, "MBSE BBS v%s chat server; type /help for help", VERSION);
system_msg(usr_list[i].pid, temp);
snprintf(temp, 200, "Welcome to the Internet BBS Chat Network");
snprintf(temp, 80, "Welcome to the Internet BBS Chat Network");
system_msg(usr_list[i].pid, temp);
snprintf(temp, 200, "Current connected servers:");
snprintf(temp, 80, "Current connected servers:");
system_msg(usr_list[i].pid, temp);
for (j = 0; j < MAXIBC_SRV; j++) {
if (strlen(srv_list[j].server)) {
snprintf(temp, 200, " %d user%s at '%s'",
snprintf(temp, 80, " %d user%s at '%s'",
srv_list[j].users, (srv_list[j].users == 1) ? " ":"s", srv_list[j].fullname);
system_msg(usr_list[i].pid, temp);
count += srv_list[j].users;
}
}
snprintf(temp, 200, "There %s %d user%s connected", (count != 1)?"are":"is", count, (count != 1)?"s":"");
snprintf(temp, 80, "There %s %d user%s connected", (count != 1)?"are":"is", count, (count != 1)?"s":"");
system_msg(usr_list[i].pid, temp);
snprintf(buf, 200, "100:0;");
snprintf(buf, 80, "100:0;");
free(realname);
free(nick);
free(temp);