A lot of fixes found with valgrind
This commit is contained in:
parent
fab5a2edae
commit
f0bbdba104
43
ChangeLog
43
ChangeLog
@ -2,24 +2,67 @@ $Id$
|
||||
|
||||
v0.39.3 26-Nov-2003
|
||||
|
||||
WARNING: NOT EVERYTHING IS TESTED, WAIT A FEW DAYS AND DON'T USE THIS.
|
||||
|
||||
general:
|
||||
Since this version Posix threads are being used, please let
|
||||
me know if this doesn't compile on you system.
|
||||
All Makefiles do not strip the binaries anymore, the binaries
|
||||
are stripped during make install only. This allows to run the
|
||||
not yet installed binaries under debuggers.
|
||||
The configure script has a --enable-debugging option so that
|
||||
all code can be compiled to let it run under debuggers.
|
||||
|
||||
libclcomm:
|
||||
Fixed a small (not harmfull) buffer overlapped copy detected
|
||||
by valgrind.
|
||||
|
||||
libcommon:
|
||||
Code cleanup in proglock and pktname.
|
||||
Fixed a forgotten fclose in proglock.
|
||||
|
||||
libmsgbase:
|
||||
In JAM_Open replaced a strcpy with memmove.
|
||||
|
||||
mbcico:
|
||||
Dropped binkp CRC support because it will be incompatible with
|
||||
future extensions.
|
||||
Fixed a small memory leak.
|
||||
|
||||
mbfido:
|
||||
Fixed a small memory leak.
|
||||
|
||||
mbfile:
|
||||
Fixed a uninitialized memory pointer in the index command.
|
||||
|
||||
mbindex:
|
||||
Fixed a forgotten file close.
|
||||
|
||||
mbsetup:
|
||||
Removed binkp CRC settings.
|
||||
Fixed a unitialized unlink call in nodes close.
|
||||
Fixed unclosed tempfile.
|
||||
Fixed several small memory leaks.
|
||||
|
||||
mbsebbs:
|
||||
Fixed small memory leak.
|
||||
|
||||
mball:
|
||||
Fixed 2 forgotten fclose functions.
|
||||
|
||||
mbuser:
|
||||
Fixed a forgotten file close when nothing was done.
|
||||
|
||||
mbmon:
|
||||
Fixed a minor problem with an uninitialized array.
|
||||
|
||||
mbtask:
|
||||
The ping function now runs in a separate thread.
|
||||
Changed some ping timer logic.
|
||||
|
||||
mbpasswd:
|
||||
Fixed a small memory leak.
|
||||
|
||||
|
||||
v0.39.2 21-Nov-2003 - 26-Nov-2003
|
||||
|
||||
|
@ -33,6 +33,7 @@ MAKE = @MAKE@
|
||||
JOEBIN = @joebin@
|
||||
JOELIB = @joelib@
|
||||
|
||||
CFLAGS = -O2 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe
|
||||
CFLAGS = @COMPILEFLAGS@
|
||||
LIBS = @LIBS@
|
||||
PTLIBS = @PTLIBS@
|
||||
|
||||
|
18
TODO
18
TODO
@ -29,7 +29,12 @@ libdiesel.a:
|
||||
U: Processed stringlines containing unbalanced " characters are not
|
||||
processed, instead the previous macro value will be returned.
|
||||
|
||||
mbtask:
|
||||
N: Test with valgrind.
|
||||
|
||||
mbsebbs:
|
||||
N: Test with valgrind.
|
||||
|
||||
X: Better word wrapping or paragraph justification in editor.
|
||||
|
||||
X: E-mail downloads with e-mail verification.
|
||||
@ -57,6 +62,8 @@ mbsebbs:
|
||||
N: Reimplememnt CHRS kludge.
|
||||
|
||||
newuser:
|
||||
N: Test with valgrind.
|
||||
|
||||
L: Allow handles to be the same as the unixname.
|
||||
|
||||
|
||||
@ -108,7 +115,13 @@ mbfido:
|
||||
N: With auto created areas golded.inc is not adjusted to the new
|
||||
setup.
|
||||
|
||||
N: After readalias we need to free the alias list when mbfido ends.
|
||||
|
||||
N: Tic, toss, scan tests with valgrind.
|
||||
|
||||
mbcico:
|
||||
N: Test with valgrind, binkp is ok.
|
||||
|
||||
N: Upgrade binkp protocol to 1.1.
|
||||
|
||||
N: With binkp, if the other node is a binkp/1.0 mailer without MB
|
||||
@ -120,6 +133,9 @@ mbcico:
|
||||
|
||||
U: Fix binkp file resume when mbcico silently dies.
|
||||
|
||||
mbout:
|
||||
N: Fix prepbuf in libcommon so that valgind can test this.
|
||||
|
||||
mbfile:
|
||||
L: Add a check to see if the magic filenames are (still) valid.
|
||||
|
||||
@ -129,6 +145,8 @@ mbfile:
|
||||
|
||||
L: Possibility to skip file areas from checking and reindexing.
|
||||
|
||||
N: Test with valgrind.
|
||||
|
||||
mbmsg:
|
||||
N: With the post command if a netmail area is used the netmail area
|
||||
will cause trouble later, should be blocked to be used on netmail
|
||||
|
15
configure.in
15
configure.in
@ -55,11 +55,19 @@ CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes"
|
||||
|
||||
dnl Additional commandline switches
|
||||
AC_ARG_ENABLE(experiment, [ --enable-experiment Compile experimental code], [ experiment=$enableval ], [ experiment=no ])
|
||||
|
||||
if test "$experiment" = "yes"; then
|
||||
AC_DEFINE(USE_EXPERIMENT)
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(debugging, [ --enable-debugging Compile for debugging], [ debugging=$enableval ], [ debugging=no ])
|
||||
if test "$debugging" = "yes"; then
|
||||
COMPILEFLAGS="-O -g -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe"
|
||||
else
|
||||
COMPILEFLAGS="-O2 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe"
|
||||
fi
|
||||
AC_SUBST(COMPILEFLAGS)
|
||||
|
||||
|
||||
dnl Defines for MBSE BBS (must use tests or --enable-stuff later)
|
||||
AC_DEFINE_UNQUOTED(RESTAMP_OLD_POSTINGS, 21)
|
||||
AC_DEFINE(RESTAMP_FUTURE_POSTINGS)
|
||||
@ -140,15 +148,16 @@ fi
|
||||
PTHREADS=No
|
||||
AC_CHECK_LIB(pthread,pthread_create,result=yes,result=no)
|
||||
if test "$result" = "yes"; then
|
||||
LIBS="$LIBS -lpthread"
|
||||
PTLIBS="$PTLIBS -lpthread"
|
||||
AC_CHECK_HEADERS(pthread.h,PTHREADS=Yes,PTHREADS=No)
|
||||
else
|
||||
AC_CHECK_LIB(c_r,pthread_create,result=yes,result=no)
|
||||
if test "$result" = "yes"; then
|
||||
LIBS="$LIBS -lc_r"
|
||||
PTLIBS="$PTLIBS -lc_r"
|
||||
AC_CHECK_HEADERS(pthread.h,PTHREADS=Yes,PTHREADS=No)
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(PTLIBS)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
|
@ -50,8 +50,7 @@ char cpath[108]; /* Client socket path */
|
||||
int socket_connect(char *user, char *prg, char *city)
|
||||
{
|
||||
int s;
|
||||
static char buf[SS_BUFSIZE];
|
||||
static char tty[18];
|
||||
static char buf[SS_BUFSIZE], tty[18];
|
||||
|
||||
myname = prg;
|
||||
|
||||
@ -104,11 +103,11 @@ int socket_connect(char *user, char *prg, char *city)
|
||||
if (isatty(1) && (ttyname(1) != NULL)) {
|
||||
strcpy(tty, ttyname(1));
|
||||
if (strchr(tty, 'p'))
|
||||
strcpy(tty, index(tty, 'p'));
|
||||
memccpy(tty, index(tty, 'p'), '\0', strlen(tty));
|
||||
else if (strchr(tty, 't'))
|
||||
strcpy(tty, index(tty, 't'));
|
||||
memccpy(tty, index(tty, 't'), '\0', strlen(tty));
|
||||
else if (strchr(tty, 'c'))
|
||||
strcpy(tty, index(tty, 'c'));
|
||||
memccpy(tty, index(tty, 'c'), '\0', strlen(tty));
|
||||
} else {
|
||||
strcpy(tty, "-");
|
||||
}
|
||||
|
@ -303,7 +303,6 @@ int noderecord(faddr *);
|
||||
/*
|
||||
* From pktname.c
|
||||
*/
|
||||
char *prepbuf(faddr *);
|
||||
char *pktname(faddr *, char);
|
||||
char *reqname(faddr *);
|
||||
char *floname(faddr *, char);
|
||||
|
@ -10,7 +10,7 @@
|
||||
* MBSE BBS and utilities.
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -566,7 +566,7 @@ int JAM_Open(char *Msgbase)
|
||||
fdJlr = open(File, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
|
||||
RetVal = TRUE;
|
||||
|
||||
strcpy(BaseName, Msgbase);
|
||||
memmove(BaseName, Msgbase, strlen(Msgbase));
|
||||
} else {
|
||||
close(fdHdr);
|
||||
fdHdr = -1;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: BinkleyTerm outbound naming
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -51,13 +51,12 @@
|
||||
#define ltyp "pol"
|
||||
|
||||
|
||||
static char buf[PATH_MAX];
|
||||
|
||||
|
||||
char *prepbuf(faddr *);
|
||||
char *prepbuf(faddr *addr)
|
||||
{
|
||||
char *p, *domain=NULL;
|
||||
char zpref[8];
|
||||
static char buf[PATH_MAX];
|
||||
char *p, *domain=NULL, zpref[8];
|
||||
int i;
|
||||
|
||||
sprintf(buf, "%s", CFG.outbound);
|
||||
@ -74,17 +73,16 @@ char *prepbuf(faddr *addr)
|
||||
* If we got a 5d address we use the given domain, if
|
||||
* we got a 4d address, we look for a matching domain name.
|
||||
*/
|
||||
if (addr->domain)
|
||||
if (addr && addr->domain && strlen(addr->domain)) {
|
||||
domain = xstrcpy(addr->domain);
|
||||
else
|
||||
} else
|
||||
for (i = 0; i < 40; i++)
|
||||
if (CFG.aka[i].zone == addr->zone) {
|
||||
domain = xstrcpy(CFG.aka[i].domain);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((domain != NULL) && (strlen(CFG.aka[0].domain) != 0) &&
|
||||
(strcasecmp(domain,CFG.aka[0].domain) != 0)) {
|
||||
if ((domain != NULL) && (strlen(CFG.aka[0].domain) != 0) && (strcasecmp(domain,CFG.aka[0].domain) != 0)) {
|
||||
if ((p = strrchr(buf,'/')))
|
||||
p++;
|
||||
else
|
||||
@ -93,8 +91,7 @@ char *prepbuf(faddr *addr)
|
||||
for (; *p; p++)
|
||||
*p = tolower(*p);
|
||||
for (i = 0; i < 40; i++)
|
||||
if ((strlen(CFG.aka[i].domain)) &&
|
||||
(strcasecmp(CFG.aka[i].domain, domain) == 0))
|
||||
if ((strlen(CFG.aka[i].domain)) && (strcasecmp(CFG.aka[i].domain, domain) == 0))
|
||||
break;
|
||||
|
||||
/*
|
||||
@ -124,99 +121,105 @@ char *prepbuf(faddr *addr)
|
||||
else
|
||||
sprintf(p,"%s/%04x%04x.",zpref,addr->net,addr->node);
|
||||
|
||||
p = buf + strlen(buf);
|
||||
if (domain)
|
||||
free(domain);
|
||||
return p;
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *pktname(faddr *addr, char flavor)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
if (flavor == 'f')
|
||||
flavor = 'o';
|
||||
|
||||
sprintf(p, "%c%s", flavor, ptyp);
|
||||
Syslog('O', "packet name is \"%s\"",buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%c%s", flavor, ptyp);
|
||||
Syslog('O', "packet name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *floname(faddr *addr, char flavor)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
if (flavor == 'o')
|
||||
flavor = 'f';
|
||||
sprintf(p, "%c%s", flavor, ftyp);
|
||||
Syslog('O', "flo file name is \"%s\"",buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%c%s", flavor, ftyp);
|
||||
Syslog('O', "flo file name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *reqname(faddr *addr)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
sprintf(p, "%s", rtyp);
|
||||
Syslog('O', "req file name is \"%s\"",buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%s", rtyp);
|
||||
Syslog('O', "req file name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *splname(faddr *addr)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
sprintf(p, "%s", styp);
|
||||
Syslog('O', "spl file name is \"%s\"",buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%s", styp);
|
||||
Syslog('O', "spl file name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *bsyname(faddr *addr)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
sprintf(p, "%s", btyp);
|
||||
Syslog('O', "bsy file name is \"%s\"",buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%s", btyp);
|
||||
Syslog('O', "bsy file name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *stsname(faddr *addr)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
sprintf(p, "%s", qtyp);
|
||||
Syslog('O', "sts file name is \"%s\"",buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%s", qtyp);
|
||||
Syslog('O', "sts file name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
|
||||
char *polname(faddr *addr)
|
||||
{
|
||||
char *p;
|
||||
static char *p, *q;
|
||||
|
||||
p = prepbuf(addr);
|
||||
sprintf(p, "%s", ltyp);
|
||||
Syslog('O', "pol file name is \"%s\"", buf);
|
||||
return buf;
|
||||
q = p + strlen(p);
|
||||
sprintf(q, "%s", ltyp);
|
||||
Syslog('O', "pol file name is \"%s\"", p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
@ -228,6 +231,7 @@ char *dayname(void)
|
||||
{
|
||||
time_t tt;
|
||||
struct tm *ptm;
|
||||
static char buf[3];
|
||||
|
||||
tt = time(NULL);
|
||||
ptm = localtime(&tt);
|
||||
@ -240,6 +244,7 @@ char *dayname(void)
|
||||
|
||||
char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat)
|
||||
{
|
||||
static char *buf;
|
||||
char *p;
|
||||
char *ext;
|
||||
time_t tt;
|
||||
@ -252,7 +257,7 @@ char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat)
|
||||
|
||||
bestaka = bestaka_s(addr);
|
||||
|
||||
(void)prepbuf(addr);
|
||||
buf = prepbuf(addr);
|
||||
p = strrchr(buf, '/');
|
||||
|
||||
if (!ARCmailCompat && (Zone != addr->zone)) {
|
||||
|
@ -127,18 +127,14 @@ void ulockprogram(char *progname)
|
||||
free(lockfile);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fscanf(fp, "%u", &oldpid) != 1) {
|
||||
WriteError("$Can't read old pid from \"%s\"", lockfile);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
unlink(lockfile);
|
||||
free(lockfile);
|
||||
return;
|
||||
}
|
||||
|
||||
if (oldpid == getpid()) {
|
||||
(void)unlink(lockfile);
|
||||
}
|
||||
|
||||
free(lockfile);
|
||||
lockfile = NULL;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,10 @@ void die(int onsig)
|
||||
|
||||
t_end = time(NULL);
|
||||
Syslog(' ', "MBCICO finished in %s", t_elapsed(t_start, t_end));
|
||||
|
||||
free_mem();
|
||||
deinitnl();
|
||||
|
||||
if (envptr)
|
||||
free(envptr);
|
||||
ExitClient(onsig);
|
||||
@ -190,9 +193,9 @@ int main(int argc, char *argv[])
|
||||
* Catch all signals we can, and ignore the rest.
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM) || (i == SIGKILL)) {
|
||||
if ((i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM)) {
|
||||
signal(i, (void (*))die);
|
||||
} else {
|
||||
} else if ((i != SIGKILL) && (i != SIGSTOP)) {
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "outstat.h"
|
||||
#include "nlinfo.h"
|
||||
|
||||
extern int most_debug;
|
||||
|
||||
extern int do_quiet; /* Suppress screen output */
|
||||
int do_attach = FALSE; /* Send file attaches */
|
||||
@ -179,6 +180,8 @@ int main(int argc, char *argv[])
|
||||
FILE *fl;
|
||||
unsigned long cmmask;
|
||||
|
||||
most_debug = TRUE;
|
||||
|
||||
InitConfig();
|
||||
InitNode();
|
||||
InitFidonet();
|
||||
|
@ -373,7 +373,7 @@ int poll(faddr *addr, int stop)
|
||||
if (addr == NULL)
|
||||
return 0;
|
||||
|
||||
pol = polname(addr);
|
||||
pol = xstrcpy(polname(addr));
|
||||
|
||||
if (stop) {
|
||||
if (access(pol, R_OK) == 0) {
|
||||
@ -393,18 +393,21 @@ int poll(faddr *addr, int stop)
|
||||
Syslog('+', "Node %s not in nodelist", ascfnode(addr, 0x1f));
|
||||
if (!do_quiet)
|
||||
printf("Node %s not in nodelist", ascfnode(addr, 0x1f));
|
||||
free(pol);
|
||||
return MBERR_NODE_NOT_IN_LIST;
|
||||
}
|
||||
if (nlent->pflag == NL_DOWN) {
|
||||
Syslog('+', "Node %s has status Down", ascfnode(addr, 0x1f));
|
||||
if (!do_quiet)
|
||||
printf("Node %s has status Down", ascfnode(addr, 0x1f));
|
||||
free(pol);
|
||||
return MBERR_NODE_MAY_NOT_CALL;
|
||||
}
|
||||
if (nlent->pflag == NL_HOLD) {
|
||||
Syslog('+', "Node %s has status Hold", ascfnode(addr, 0x1f));
|
||||
if (!do_quiet)
|
||||
printf("Node %s has status Hold", ascfnode(addr, 0x1f));
|
||||
free(pol);
|
||||
return MBERR_NODE_MAY_NOT_CALL;
|
||||
}
|
||||
|
||||
@ -438,6 +441,7 @@ int poll(faddr *addr, int stop)
|
||||
}
|
||||
}
|
||||
|
||||
free(pol);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -215,6 +215,7 @@ int dirinbound(void)
|
||||
}
|
||||
fseek(fp, nodeshdr.filegrp + nodeshdr.mailgrp, SEEK_CUR);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
free(temp);
|
||||
Syslog('m', "Finished directory inbound sessions");
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Announce new files and FileFind
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -112,7 +112,7 @@ int main(int argc, char **argv)
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGHUP) || (i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
|
@ -130,9 +130,9 @@ int main(int argc, char **argv)
|
||||
* Catch all signals we can, and ignore the rest.
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGHUP) || (i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGKILL))
|
||||
if ((i == SIGHUP) || (i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
|
@ -202,6 +202,7 @@ void die(int onsig)
|
||||
Msg_Close();
|
||||
|
||||
signal(onsig, SIG_IGN);
|
||||
deinitnl();
|
||||
|
||||
if (!do_quiet) {
|
||||
show_log = TRUE;
|
||||
@ -320,9 +321,9 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
for(i = 0; i < NSIG; i++) {
|
||||
|
||||
if ((i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM) || (i == SIGKILL))
|
||||
if ((i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
|
@ -88,9 +88,9 @@ int main(int argc, char **argv)
|
||||
* Catch all signals we can, and ignore the rest.
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGHUP) || (i == SIGBUS) || (i == SIGKILL) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
if ((i == SIGHUP) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
|
@ -324,9 +324,9 @@ void closepage(FILE *fa, char *Path, int inArea, int Current, FILE *fi)
|
||||
sprintf(temp2, "%s/index.temp", Path);
|
||||
}
|
||||
rename(temp2, temp1);
|
||||
chmod(temp1, 0644);
|
||||
free(temp1);
|
||||
free(temp2);
|
||||
chmod(temp1, 0644);
|
||||
fa = NULL;
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ int main(int argc,char *argv[])
|
||||
|
||||
if ((i == SIGHUP) || (i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
@ -581,6 +581,7 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
|
||||
fill_nllist(ndx, &nll);
|
||||
}
|
||||
|
||||
fclose(nl);
|
||||
Syslog('+', "%d entries", entries);
|
||||
|
||||
if (!do_quiet) {
|
||||
|
@ -98,10 +98,9 @@ int main(int argc, char **argv)
|
||||
* Catch all signals we can, and ignore or catch them
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGHUP) || (i == SIGBUS) || (i == SIGILL) ||
|
||||
(i == SIGSEGV) || (i == SIGTERM) || (i == SIGKILL))
|
||||
if ((i == SIGHUP) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Netmail tracker / router
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -267,6 +267,7 @@ int IsLocal(char *ftn, fidoaddr *res)
|
||||
}
|
||||
}
|
||||
|
||||
tidy_faddr(dest);
|
||||
return R_NOROUTE;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Common utilities
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -208,8 +208,7 @@ void Nopper(void)
|
||||
int socket_connect(char *user)
|
||||
{
|
||||
int s;
|
||||
static char buf[SS_BUFSIZE];
|
||||
char tty[18];
|
||||
static char buf[SS_BUFSIZE], tty[18];
|
||||
|
||||
if ((s = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) {
|
||||
perror("mbmon");
|
||||
@ -239,11 +238,11 @@ int socket_connect(char *user)
|
||||
if (isatty(1) && (ttyname(1) != NULL)) {
|
||||
strcpy(tty, ttyname(1));
|
||||
if (strchr(tty, 'p'))
|
||||
strcpy(tty, index(tty, 'p'));
|
||||
memccpy(tty, index(tty, 'p'), '\0', strlen(tty));
|
||||
else if (strchr(tty, 't'))
|
||||
strcpy(tty, index(tty, 't'));
|
||||
memccpy(tty, index(tty, 't'), '\0', strlen(tty));
|
||||
else if (strchr(tty, 'c'))
|
||||
strcpy(tty, index(tty, 'c'));
|
||||
memccpy(tty, index(tty, 'c'), '\0', strlen(tty));
|
||||
} else {
|
||||
strcpy(tty, "-");
|
||||
}
|
||||
|
@ -319,11 +319,8 @@ void system_stat(void)
|
||||
void disk_stat(void)
|
||||
{
|
||||
int ch, i;
|
||||
char buf[1024];
|
||||
char *cnt, *type, *fs, *p;
|
||||
unsigned long last[10];
|
||||
unsigned long size, used, perc;
|
||||
char sign;
|
||||
char buf[1024], *cnt, *type, *fs, *p, sign;
|
||||
unsigned long last[10], size, used, perc;
|
||||
|
||||
clr_index();
|
||||
set_color(WHITE, BLACK);
|
||||
@ -333,6 +330,8 @@ void disk_stat(void)
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw(lines - 2, 6, "Press any key");
|
||||
IsDoing("Filesystem Usage");
|
||||
for (i = 0; i < 10; i++)
|
||||
last[i] = 0;
|
||||
|
||||
do {
|
||||
show_date(LIGHTGRAY, BLACK, 0, 0);
|
||||
@ -361,8 +360,7 @@ void disk_stat(void)
|
||||
sign = ' ';
|
||||
last[i] = used;
|
||||
set_color(CYAN, BLACK);
|
||||
mvprintw(i+8, 1, "%8lu %8lu ",
|
||||
size, used);
|
||||
mvprintw(i+8, 1, "%8lu %8lu ", size, used);
|
||||
set_color(WHITE, BLACK);
|
||||
printf("%c ", sign);
|
||||
set_color(CYAN, BLACK);
|
||||
|
@ -130,6 +130,7 @@ void ulockprogram(char *progname)
|
||||
free(lockfile);
|
||||
return;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
if (oldpid == getpid()) {
|
||||
(void)unlink(lockfile);
|
||||
|
@ -145,9 +145,9 @@ int main(int argc, char **argv)
|
||||
* Catch all signals we can, and ignore the rest.
|
||||
*/
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGHUP) || (i == SIGKILL) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
if ((i == SIGHUP) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
@ -324,6 +324,7 @@ void Masterlist()
|
||||
fprintf(fp, "%s\r\n", temp);
|
||||
fprintf(np, "%s\r\n", temp);
|
||||
}
|
||||
fclose(pHeader);
|
||||
}
|
||||
|
||||
while (fread(&area, areahdr.recsize, 1, pAreas) == 1) {
|
||||
@ -457,6 +458,7 @@ void Masterlist()
|
||||
fprintf(fp, "%s\r\n", temp);
|
||||
fprintf(np, "%s\r\n", temp);
|
||||
}
|
||||
fclose(pHeader);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
@ -505,6 +507,7 @@ void MakeArc()
|
||||
(char *)"/dev/null", (char *)"/dev/null") == 0)
|
||||
WriteError("Create newfiles.zip failed");
|
||||
free(cmd);
|
||||
cmd = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -125,6 +125,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if ((tty = ttyname(0)) == NULL) {
|
||||
WriteError("Not at a tty");
|
||||
Free_Language();
|
||||
Quick_Bye(MBERR_OK);
|
||||
}
|
||||
|
||||
@ -160,6 +161,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
if (CheckStatus() == FALSE) {
|
||||
Syslog('+', "Kicking user out, the BBS is closed");
|
||||
Free_Language();
|
||||
Quick_Bye(MBERR_OK);
|
||||
}
|
||||
|
||||
@ -192,6 +194,7 @@ int main(int argc, char **argv)
|
||||
if ((strcmp(ttyinfo.tty, pTTY) != 0) || (!ttyinfo.available)) {
|
||||
Syslog('+', "No BBS allowed on port \"%s\"", pTTY);
|
||||
printf("No BBS on this port allowed!\n\n");
|
||||
Free_Language();
|
||||
Quick_Bye(MBERR_OK);
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ int main(int argc, char **argv)
|
||||
for (i = 0; i < NSIG; i++) {
|
||||
if ((i == SIGHUP) || (i == SIGINT) || (i == SIGBUS) || (i == SIGILL) || (i == SIGSEGV) || (i == SIGTERM))
|
||||
signal(i, (void (*))die);
|
||||
else
|
||||
else if ((i != SIGKILL) && (i != SIGSTOP))
|
||||
signal(i, SIG_IGN);
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,10 @@ void UserPack(int days, int level, int pack)
|
||||
fclose(fout);
|
||||
chmod(fnin, 0660);
|
||||
Syslog('+', "Userbase is updated, written %d records", record);
|
||||
} else {
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
unlink(fnout);
|
||||
free(fnin);
|
||||
free(fnout);
|
||||
|
@ -211,6 +211,7 @@ void user()
|
||||
printf("%s\n", (char *) Language(390));
|
||||
Syslog('?', "FATAL: Could not find user in BBS users file.");
|
||||
Syslog('?', " and system is using unix accounts\n");
|
||||
Free_Language();
|
||||
ExitClient(MBERR_OK);
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ void gold_akamatch(FILE *fp)
|
||||
{
|
||||
char temp[PATH_MAX];
|
||||
FILE *fido;
|
||||
faddr *want;
|
||||
faddr *want, *ta;
|
||||
int i;
|
||||
|
||||
sprintf(temp, "%s/etc/fidonet.data", getenv("MBSE_ROOT"));
|
||||
@ -486,14 +486,16 @@ void gold_akamatch(FILE *fp)
|
||||
want->point = 0;
|
||||
want->name = NULL;
|
||||
want->domain = NULL;
|
||||
fprintf(fp, "AKAMATCH %d:* %s\n", fidonet.zone[i], ascfnode(bestaka_s(want), 0xf));
|
||||
ta = bestaka_s(want);
|
||||
fprintf(fp, "AKAMATCH %d:* %s\n", fidonet.zone[i], ascfnode(ta, 0xf));
|
||||
tidy_faddr(ta);
|
||||
}
|
||||
}
|
||||
|
||||
free(want);
|
||||
fprintf(fp, ";\n");
|
||||
fprintf(fp, "AKAMATCHNET YES\n");
|
||||
fprintf(fp, "AKAMATCHECHO YES\n"); /* On request, should work better */
|
||||
fprintf(fp, "AKAMATCHECHO YES\n");
|
||||
fprintf(fp, "AKAMATCHLOCAL NO\n\n");
|
||||
|
||||
fprintf(fp, "; NODELISTS\n;\n");
|
||||
|
@ -779,7 +779,7 @@ void s_fidomailcfg(void)
|
||||
mvprintw(12,42, "13. 4d address");
|
||||
mvprintw(13,42, "14. Split at");
|
||||
mvprintw(14,42, "15. Force at");
|
||||
mvprintw(15,42, "16. Allow %+*");
|
||||
mvprintw(15,42, "16. Allow +*");
|
||||
mvprintw(16,42, "17. Notify");
|
||||
mvprintw(17,42, "18. Passwd");
|
||||
mvprintw(18,42, "19. Pause");
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Message Areas Setup
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -714,7 +714,8 @@ void MsgGlobal(void)
|
||||
|
||||
menu = select_menu(13);
|
||||
switch (menu) {
|
||||
case 0: return;
|
||||
case 0: tidy_grlist(&mgr);
|
||||
return;
|
||||
case 1: a1 = PullUplink((char *)"AKA TO DELETE");
|
||||
break;
|
||||
case 2: a2 = PullUplink((char *)"AKA TO ADD");
|
||||
@ -991,6 +992,7 @@ void MsgGlobal(void)
|
||||
}
|
||||
if (tfil != NULL)
|
||||
fclose(tfil);
|
||||
tfil = NULL;
|
||||
}
|
||||
|
||||
working(0, 0, 0);
|
||||
@ -1099,6 +1101,9 @@ int EditMsgRec(int Area)
|
||||
Syslog('+', "Saved message area record %d", Area);
|
||||
}
|
||||
}
|
||||
if (tfil != NULL)
|
||||
fclose(tfil);
|
||||
tfil = NULL;
|
||||
IsDoing("Browsing Menu");
|
||||
return 0;
|
||||
case 1: E_STR( 6,16,40,msgs.Name, "The ^Name^ of this area")
|
||||
|
@ -270,10 +270,10 @@ void CloseNoderec(int Force)
|
||||
}
|
||||
|
||||
chmod(fin, 0640);
|
||||
unlink(fout);
|
||||
working(1, 0, 0);
|
||||
free(fin);
|
||||
free(fout);
|
||||
unlink(fout);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: TIC Areas Setup Program
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -611,7 +611,8 @@ void TicGlobal(void)
|
||||
|
||||
menu = select_menu(7);
|
||||
switch (menu) {
|
||||
case 0: return;
|
||||
case 0: tidy_grlist(&mgr);
|
||||
return;
|
||||
case 1: a1 = PullUplink((char *)"AKA TO DELETE");
|
||||
break;
|
||||
case 2: a2 = PullUplink((char *)"AKA TO ADD");
|
||||
@ -900,6 +901,9 @@ int EditTicRec(int Area)
|
||||
Syslog('+', "Saved tic record %d", Area);
|
||||
}
|
||||
}
|
||||
if (ttfil != NULL)
|
||||
fclose(ttfil);
|
||||
ttfil = NULL;
|
||||
IsDoing("Browsing Menu");
|
||||
free(temp);
|
||||
return 0;
|
||||
|
@ -24,7 +24,7 @@ OTHER = Makefile issue issue.netbsd
|
||||
all: mbtask
|
||||
|
||||
mbtask: ${OBJS} ${LIBS}
|
||||
${CC} -o mbtask ${OBJS} ${LIBS}
|
||||
${CC} -o mbtask ${OBJS} ${PTLIBS} ${LIBS}
|
||||
|
||||
clean:
|
||||
rm -f mbtask *.o *.h~ *.c~ version.* core filelist Makefile.bak
|
||||
|
@ -5,7 +5,7 @@
|
||||
* Shadow Suite (c) ......: Julianne Frances Haugh
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2002
|
||||
* Copyright (C) 1997-2003
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -759,10 +759,12 @@ int main(int argc, char *argv[])
|
||||
gr = getgrgid(pw->pw_gid);
|
||||
if (!gr) {
|
||||
fprintf(stderr, "mbpasswd: Cannot determine group name.\n");
|
||||
free(myname);
|
||||
exit(E_NOPERM);
|
||||
}
|
||||
if (strcmp(gr->gr_name, (char *)"bbs")) {
|
||||
fprintf(stderr, "mbpasswd: You are not a member of group \"bbs\".\n");
|
||||
free(myname);
|
||||
exit(E_NOPERM);
|
||||
}
|
||||
|
||||
@ -776,6 +778,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "mbpasswd [-opt] [username] [newpassword]\n");
|
||||
fprintf(stderr, "options are: -n normal password change\n");
|
||||
fprintf(stderr, " -f forced password change\n");
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
|
||||
@ -787,6 +790,7 @@ int main(int argc, char *argv[])
|
||||
force = 1;
|
||||
if (strcmp(pw->pw_name, (char *)"mbse") && strcmp(pw->pw_name, (char *)"bbs")) {
|
||||
fprintf(stderr, "mbpasswd: only users `mbse' and `bbs' may do this.\n");
|
||||
free(myname);
|
||||
exit(E_NOPERM);
|
||||
}
|
||||
} else if (strncmp(argv[1], "-n", 2) == 0) {
|
||||
@ -797,10 +801,12 @@ int main(int argc, char *argv[])
|
||||
force = 0;
|
||||
if (strcmp(pw->pw_name, argv[2])) {
|
||||
fprintf(stderr, "mbpasswd: only owner may do this.\n");
|
||||
free(myname);
|
||||
exit(E_NOPERM);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "mbpasswd: wrong option switch.\n");
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
|
||||
@ -809,10 +815,12 @@ int main(int argc, char *argv[])
|
||||
*/
|
||||
if (strlen(argv[2]) > 16) {
|
||||
fprintf(stderr, "mbpasswd: Username too long\n");
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
if (strlen(argv[3]) > 16) {
|
||||
fprintf(stderr, "mbpasswd: Password too long\n");
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
|
||||
@ -826,6 +834,7 @@ int main(int argc, char *argv[])
|
||||
if ((pw = getpwnam(name)) == NULL) {
|
||||
syslog(LOG_ERR, "mbpasswd: Unknown user %s", name);
|
||||
fprintf(stderr, "mbpasswd: Unknown user %s\n", name);
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
|
||||
@ -855,6 +864,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "The password for %s is unchanged.\n", name);
|
||||
syslog(LOG_ERR, "The password for %s is unchanged", name);
|
||||
closelog();
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
do_update_pwd = 1;
|
||||
@ -876,6 +886,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "Cannot change ID to root.\n");
|
||||
syslog(LOG_ERR, "can't setuid(0)");
|
||||
closelog();
|
||||
free(myname);
|
||||
exit(E_FAILURE);
|
||||
}
|
||||
|
||||
@ -927,6 +938,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
syslog(LOG_NOTICE, "password for `%s' changed by user `%s'", name, myname);
|
||||
closelog();
|
||||
free(myname);
|
||||
exit(E_SUCCESS);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user