From 8367cacff7d5e5ee393c035a984971aad6a0aab0 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 22 May 2011 17:43:12 +0200 Subject: [PATCH] Fixed compiler warnings --- lib/clcomm.c | 7 +++-- lib/mbfile.c | 7 +++-- lib/nodelist.c | 7 ++--- mbcico/binkp.c | 14 +++------- mbcico/chat.c | 6 ++--- mbcico/hydra.c | 5 +--- mbcico/openport.c | 9 +++---- mbcico/respfreq.c | 5 +--- mbcico/xmrecv.c | 8 ++---- mbcico/zmrecv.c | 11 +++----- mbfido/mbfadopt.c | 6 ++--- mbfido/mbmsg.c | 6 ++--- mbfido/ptic.c | 19 +++----------- mbfido/rfc2ftn.c | 13 ++------- mbfido/rnews.c | 5 +--- mbfido/toberep.c | 9 +++---- mbfido/tosspkt.c | 6 ++--- mbmon/mbmon.c | 23 ++++++++-------- mbnntp/rfc2ftn.c | 6 +---- mbsebbs/filesub.c | 6 ++--- mbsebbs/menu.c | 6 ++--- mbsebbs/newuser.c | 5 +--- mbsebbs/offline.c | 7 +---- mbsebbs/ttyio.c | 6 +---- mbsebbs/whoson.c | 7 +++-- mbsebbs/zmsend.c | 8 +----- mbsetup/ledit.c | 5 ++-- mbsetup/m_marea.c | 9 +++---- mbsetup/m_ticarea.c | 9 +++---- mbtask/ports.c | 9 ++----- mbtask/taskcomm.c | 9 +++---- mbtask/taskstat.c | 7 +++-- mbtask/taskutil.c | 7 +++-- mbutils/mbsnmp.c | 6 ++--- mbutils/mbuser.c | 16 +++++------- script/init.Arch | 61 +++++++++++++++++++++++++++++++++++++++++++ script/installinit.sh | 20 ++++++++++++-- unix/mbpasswd.c | 9 ++----- 38 files changed, 174 insertions(+), 210 deletions(-) create mode 100644 script/init.Arch diff --git a/lib/clcomm.c b/lib/clcomm.c index 3b226847..6bc4e2cc 100644 --- a/lib/clcomm.c +++ b/lib/clcomm.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: clcomm.c,v 1.32 2007/03/03 14:28:39 mbse Exp $ * Purpose ...............: Client/Server communications * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -484,7 +483,7 @@ unsigned int sequencer() */ int enoughspace(unsigned int needed) { - char *buf, *res; + char *buf; int rc = 3, cnt; unsigned int avail = 0L; @@ -493,7 +492,7 @@ int enoughspace(unsigned int needed) if (socket_send(buf) == 0) { snprintf(buf, SS_BUFSIZE, "%s", socket_receive()); - res = strtok(buf, ":"); + strtok(buf, ":"); cnt = atoi(strtok(NULL, ",")); if (cnt == 1) { rc = atoi(strtok(NULL, ";")); diff --git a/lib/mbfile.c b/lib/mbfile.c index 2a0cea83..a0513215 100644 --- a/lib/mbfile.c +++ b/lib/mbfile.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: mbfile.c,v 1.19 2005/12/03 15:09:06 mbse Exp $ * Purpose ...............: Basic File I/O * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -223,7 +222,7 @@ time_t file_time(char *path) int mkdirs(char *name, mode_t mode) { char buf[PATH_MAX], *p, *q; - int rc, last = 0, oldmask; + int last = 0, oldmask; memset(&buf, 0, sizeof(buf)); strncpy(buf, name, sizeof(buf)-1); @@ -234,7 +233,7 @@ int mkdirs(char *name, mode_t mode) oldmask = umask(000); while ((q = strchr(p, '/'))) { *q = '\0'; - rc = mkdir(buf, mode); + mkdir(buf, mode); last = errno; *q = '/'; p = q+1; diff --git a/lib/nodelist.c b/lib/nodelist.c index 0deeb415..bd82c384 100644 --- a/lib/nodelist.c +++ b/lib/nodelist.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: nodelist.c,v 1.37 2007/07/09 18:43:53 mbse Exp $ * Purpose ...............: Read nodelists information * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -354,7 +353,7 @@ void deinitnl(void) */ int initnl(void) { - int i, rc = 0, Found; + int i, rc = 0; FILE *dbf, *fp; char *filexnm, buf[256], *p, *q; struct _nlfil fdx; @@ -450,8 +449,6 @@ int initnl(void) fclose(dbf); } - Found = FALSE; - /* * Howmany TCP sessions are allowd */ diff --git a/mbcico/binkp.c b/mbcico/binkp.c index b7eb123f..93c1bdba 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -1806,7 +1806,7 @@ int binkp_send_frame(int cmd, char *buf, int len) unsigned short header = 0; int rc, id; #ifdef HAVE_ZLIB_H - int rcz, last; + int rcz; uLongf zlen; Bytef *zbuf; @@ -1833,7 +1833,6 @@ int binkp_send_frame(int cmd, char *buf, int len) } #ifdef HAVE_ZLIB_H - last = bp.cmpblksize; /* * Only use compression for DATA blocks larger then 20 bytes. * Also, don't send PLZ blocks if GZ or BZ2 mode is active. @@ -2433,7 +2432,7 @@ int binkp_process_messages(void) the_queue *tmpq, *oldq; binkp_list *tmp; file_list *tsl; - int Found, rmode; + int Found; char *lname, *ropts; time_t ltime; int lsize, loffs; @@ -2446,20 +2445,13 @@ int binkp_process_messages(void) for (tmpq = tql; tmpq; tmpq = tmpq->next) { Syslog('+', "Binkp: %s \"%s\"", bstate[tmpq->cmd], printable(tmpq->data, 0)); if (tmpq->cmd == MM_GET) { - rmode = CompNone; snprintf(lname, 512, "%s", strtok(tmpq->data, " \n\r")); lsize = atoi(strtok(NULL, " \n\r")); ltime = atoi(strtok(NULL, " \n\r")); loffs = atoi(strtok(NULL, " \n\r")); snprintf(ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0)); Syslog('b', "Binkp: m_file options \"%s\"", ropts); - if (strcmp((char *)"GZ", ropts) == 0) - rmode = CompGZ; - else if (strcmp((char *)"BZ2", ropts) == 0) - rmode = CompBZ2; - else - if (strcmp((char *)"NZ", ropts) == 0) { - rmode = CompNone; + if (strcmp((char *)"NZ", ropts) == 0) { #ifdef HAVE_ZLIB_H bp.GZwe = bp.GZthey = No; #endif diff --git a/mbcico/chat.c b/mbcico/chat.c index 932e8ad0..5a754844 100644 --- a/mbcico/chat.c +++ b/mbcico/chat.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: chat.c,v 1.11 2005/08/28 13:45:26 mbse Exp $ * Purpose ...............: Fidonet mailer - modem chat * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -146,7 +145,7 @@ void almhdl(int sig) int expect_str(int, int, char *); int expect_str(int timeout, int aftermode, char *Phone) { - int matched = FALSE, smatch = FALSE, ematch = FALSE, ioerror = FALSE, i, rc; + int matched = FALSE, smatch = FALSE, ioerror = FALSE, i, rc; char inbuf[256]; unsigned char ch = '\0'; int eol = FALSE; @@ -188,7 +187,6 @@ int expect_str(int timeout, int aftermode, char *Phone) if (strlen(modem.error[i])) if (strncmp(modem.error[i], inbuf, strlen(modem.error[i])) == 0) { matched = TRUE; - ematch = TRUE; Syslog('+', "chat: got \"%s\", aborting", printable(inbuf, 0)); } diff --git a/mbcico/hydra.c b/mbcico/hydra.c index b91d0b2d..16d58bca 100644 --- a/mbcico/hydra.c +++ b/mbcico/hydra.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * $Id: hydra.c,v 1.36 2007/08/25 18:32:07 mbse Exp $ * Purpose ...............: Fidonet mailer - Hydra protocol driver * Remark ................: See below for more copyright details and credits. * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -1405,7 +1404,6 @@ int hydra_batch(int role, file_list *to_send) */ else if ((rxlen > 41) && (rxbuf[rxlen - 1] == 0)) { time_t timestamp; - time_t orgstamp; int filesize, tt; char dosname[8 + 1 + 3 + 1], *Name; @@ -1413,7 +1411,6 @@ int hydra_batch(int role, file_list *to_send) timestamp = (time_t)tt; /* convert timestamp to UNIX time */ - orgstamp = timestamp; timestamp = sl2mtime(timestamp); /* diff --git a/mbcico/openport.c b/mbcico/openport.c index 6e5dc812..12043f3a 100644 --- a/mbcico/openport.c +++ b/mbcico/openport.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: openport.c,v 1.11 2007/08/26 12:21:16 mbse Exp $ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -387,7 +386,7 @@ static struct termios tios; int tty_raw(int speed) { int rc; - speed_t tspeed, is, os; + speed_t tspeed; Syslog('t', "Set tty raw"); tspeed = transpeed(speed); @@ -414,8 +413,8 @@ int tty_raw(int speed) if ((rc = tcsetattr(0,TCSADRAIN,&tios))) WriteError("$tcsetattr(0,TCSADRAIN,raw) return %d",rc); - is = cfgetispeed(&tios); - os = cfgetospeed(&tios); + cfgetispeed(&tios); + cfgetospeed(&tios); return rc; } diff --git a/mbcico/respfreq.c b/mbcico/respfreq.c index 522e40f2..f820bf26 100644 --- a/mbcico/respfreq.c +++ b/mbcico/respfreq.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: respfreq.c,v 1.22 2008/11/26 22:01:01 mbse Exp $ * Purpose ...............: Fidonet mailer - respond to filerequests * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -159,7 +158,6 @@ file_list *respfreq(char *nm, char *pw, char *dt) time_t upd = 0L; int newer = 1, Send; FILE *fa, *fi; - int Area; struct FILEIndex idx; struct _fdbarea *fdb_area = NULL; @@ -246,7 +244,6 @@ file_list *respfreq(char *nm, char *pw, char *dt) WriteError("$Can't open %s", p); return NULL; } - Area = 0L; free(p); Syslog('f', "Start search ..."); diff --git a/mbcico/xmrecv.c b/mbcico/xmrecv.c index a58e9c5f..f3c1984c 100644 --- a/mbcico/xmrecv.c +++ b/mbcico/xmrecv.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: xmrecv.c,v 1.15 2007/08/26 12:21:16 mbse Exp $ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -125,7 +124,7 @@ SM_NAMES SM_EDECL int tmp, i; - int SEAlink = FALSE, Slo = FALSE; + int SEAlink = FALSE; int crcmode = session_flags & FTSC_XMODEM_CRC; int count=0,junk=0,cancount=0; int header = 0; @@ -192,7 +191,6 @@ SM_STATE(waitblk0) } else { switch (header) { case EOT: Syslog('x', "got EOT"); - Slo = FALSE; if (ackd_blk == -1L) last=1; else { @@ -457,7 +455,6 @@ SM_STATE(checktelink) remtime=sl2mtime(((time_t)xmblk.data[4])+ ((time_t)xmblk.data[5]<<8)+ ((time_t)xmblk.data[6]<<16)+ ((time_t)xmblk.data[7]<<24)); if (xmblk.data[40]) { - Slo = TRUE; remote_flags |= FTSC_XMODEM_SLO; } else remote_flags &= ~FTSC_XMODEM_SLO; @@ -519,7 +516,6 @@ SM_STATE(recvm7) SM_STATE(goteof) - Slo = FALSE; closeit(1); if (ackd_blk == -1L) last=1; diff --git a/mbcico/zmrecv.c b/mbcico/zmrecv.c index 6be0ed2f..02d9282e 100644 --- a/mbcico/zmrecv.c +++ b/mbcico/zmrecv.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: zmrecv.c,v 1.15 2007/08/26 14:02:28 mbse Exp $ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -483,20 +482,16 @@ int ackbibi(void) */ int procheader(char *Name) { - register char *openmode, *p; + register char *p; static int dummy; char ctt[32]; - Syslog('z', "procheader \"%s\"",printable(Name,0)); - /* set default parameters and overrides */ - openmode = (char *)"w"; + Syslog('z', "procheader \"%s\"", printable(Name,0)); /* * Process ZMODEM remote file management requests */ Thisbinary = (zconv != ZCNL); /* Remote ASCII override */ - if (zmanag == ZMAPND) - openmode = (char *)"a"; Bytesleft = DEFBYTL; Filemode = 0; diff --git a/mbfido/mbfadopt.c b/mbfido/mbfadopt.c index d61a7c63..467d5079 100644 --- a/mbfido/mbfadopt.c +++ b/mbfido/mbfadopt.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: mbfadopt.c,v 1.28 2008/02/17 17:50:14 mbse Exp $ * Purpose: File Database Maintenance - Adopt file * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -47,7 +46,7 @@ void AdoptFile(int Area, char *File, char *Description) FILE *fp; char *temp, *temp2, *tmpdir, *unarc, *pwd, *lname, *fileid; char Desc[256], TDesc[256]; - int IsArchive = FALSE, MustRearc = FALSE, UnPacked = FALSE; + int MustRearc = FALSE, UnPacked = FALSE; int IsVirus = FALSE, File_Id = FALSE; int i, j, k, lines = 0, File_id_cnt = 0; struct FILE_record f_db; @@ -100,7 +99,6 @@ void AdoptFile(int Area, char *File, char *Description) } if ((unarc = unpacker(File))) { - IsArchive = TRUE; if (strlen(area.Archiver) && (strcmp(unarc, area.Archiver) == 0)) MustRearc = TRUE; UnPacked = UnpackFile(temp); diff --git a/mbfido/mbmsg.c b/mbfido/mbmsg.c index 97e75621..9ec63084 100644 --- a/mbfido/mbmsg.c +++ b/mbfido/mbmsg.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: mbmsg.c,v 1.34 2007/09/02 11:17:32 mbse Exp $ * Purpose ...............: Message Base Maintenance * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -423,7 +422,7 @@ void LinkArea(char *Path, int Areanr) */ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, int Areanr) { - unsigned int Number, TotalMsgs = 0, Highest, *Active, Counter = 0; + unsigned int Number, TotalMsgs = 0, *Active, Counter = 0; int i, DelCount = 0, DelAge = 0, Done; time_t Today, MsgDate; @@ -455,7 +454,6 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, int Areanr) Active = NULL; Number = Msg_Lowest(); - Highest = Msg_Highest(); do { if (CFG.slow_util && do_quiet) diff --git a/mbfido/ptic.c b/mbfido/ptic.c index 7c526e16..a0de4fd2 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: ptic.c,v 1.68 2008/11/26 22:12:28 mbse Exp $ * Purpose ...............: Process 1 .tic file * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -67,9 +66,8 @@ extern int check_dupe; */ int ProcessTic(fa_list **sbl, orphans **opl) { - time_t Now; int First, Listed = FALSE, DownLinks = 0, MustRearc = FALSE; - int UnPacked = FALSE, IsArchive = FALSE, rc, i, j, k, File_Id = FALSE; + int UnPacked = FALSE, IsArchive = FALSE, rc, i, j, k; char *Temp, *unarc = NULL, *cmd = NULL; char temp1[PATH_MAX], temp2[PATH_MAX], sbe[24], TDesc[1024]; unsigned int crc, crc2, Kb; @@ -81,8 +79,6 @@ int ProcessTic(fa_list **sbl, orphans **opl) qualify *qal = NULL, *tmpq; orphans *topl; - Now = time(NULL); - if (TIC.TicIn.PathError) { WriteError("Our Aka is in the path"); tic_bad++; @@ -454,9 +450,6 @@ int ProcessTic(fa_list **sbl, orphans **opl) Syslog('f', "Found %s", Temp); snprintf(temp1, PATH_MAX, "%s/tmp/arc%d/%s", getenv("MBSE_ROOT"), (int)getpid(), Temp); snprintf(temp2, PATH_MAX, "%s/tmp/FILE_ID.DIZ", getenv("MBSE_ROOT")); - if (file_cp(temp1, temp2) == 0) { - File_Id = TRUE; - } } else { Syslog('f', "Didn't find a FILE_ID.DIZ"); } @@ -472,13 +465,9 @@ int ProcessTic(fa_list **sbl, orphans **opl) snprintf(temp1, PATH_MAX, "%s/tmp", getenv("MBSE_ROOT")); chdir(temp1); snprintf(temp1, PATH_MAX, "%s/%s FILE_ID.DIZ", TIC.Inbound, TIC.TicIn.File); - if (execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { - File_Id = TRUE; - } else { + if (execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) { snprintf(temp1, PATH_MAX, "%s/%s file_id.diz", TIC.Inbound, TIC.TicIn.File); - if (execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null") == 0) { - File_Id = TRUE; - } + execute_str(cmd, temp1, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null"); } free(cmd); } diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index fc86ea5b..47af30e9 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: rfc2ftn.c,v 1.55 2008/08/31 21:10:51 mbse Exp $ * Purpose ...............: Convert RFC to FTN * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -132,7 +131,7 @@ int rfc2ftn(FILE *fp, faddr *recipient) FILE *ofp; fa_list *sbl = NULL, *ptl = NULL, *tmpl; faddr *ta, *fta; - unsigned int svmsgid, svreply, acup_n = 0; + unsigned int acup_n = 0; int sot_kludge = FALSE, eot_kludge = FALSE, tinyorigin = FALSE; int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders; time_t Now; @@ -142,12 +141,6 @@ int rfc2ftn(FILE *fp, faddr *recipient) if (recipient) Syslog('m', "Recipient: %s", ascfnode(recipient, 0xff)); rewind(fp); -// Syslog('m', "========== RFC Start"); -// while ((fgets(temp, 4095, fp)) != NULL) { -// Syslogp('m', printable(temp, 0)); -// } -// Syslog('m', "========== RFC end"); -// rewind(fp); msg = parsrfc(fp); newsmode = hdr((char *)"Newsgroups", msg) ?TRUE:FALSE; @@ -175,8 +168,6 @@ int rfc2ftn(FILE *fp, faddr *recipient) if (newsmode) fmsg->area = xstrcpy(msgs.Tag); - svmsgid = fmsg->msgid_n; - svreply = fmsg->reply_n; if ((p = hdr((char *)"Message-ID",msg))) { ftnmsgid(p, &fmsg->msgid_a, &fmsg->msgid_n, fmsg->area); hash_update_s(&fmsg->msgid_n, fmsg->area); diff --git a/mbfido/rnews.c b/mbfido/rnews.c index 1ee58b4a..f545785e 100644 --- a/mbfido/rnews.c +++ b/mbfido/rnews.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * $Id: rnews.c,v 1.15 2005/10/11 20:49:47 mbse Exp $ * Purpose ...............: rnews function * Remarks ...............: Most of these functions are borrowed from inn. * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -269,7 +268,6 @@ static int Process(char *article) { HEADER *hp; char *p; - char *id = NULL; FILE *fp; /* @@ -287,7 +285,6 @@ static int Process(char *article) return FALSE; } if (IS_MESGID(hp)) { - id = p; continue; } } diff --git a/mbfido/toberep.c b/mbfido/toberep.c index eddcdfc3..77c18513 100644 --- a/mbfido/toberep.c +++ b/mbfido/toberep.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: toberep.c,v 1.18 2005/11/12 12:52:30 mbse Exp $ * Purpose ...............: Add a file to the To-Be-Reported database * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -45,7 +44,7 @@ int Add_ToBeRep(struct _filerecord report) char *fname; struct _filerecord Temp; FILE *tbr; - int rc, Found = FALSE; + int Found = FALSE; fname = calloc(PATH_MAX, sizeof(char)); snprintf(fname, PATH_MAX, "%s/etc/toberep.data", getenv("MBSE_ROOT")); @@ -67,8 +66,8 @@ int Add_ToBeRep(struct _filerecord report) * If it's a later received file, update the record */ if (report.Fdate > Temp.Fdate) { - rc = fseek(tbr, - sizeof(Temp), SEEK_CUR); - rc = fwrite(&report, sizeof(Temp), 1, tbr); + fseek(tbr, - sizeof(Temp), SEEK_CUR); + fwrite(&report, sizeof(Temp), 1, tbr); fclose(tbr); return TRUE; } diff --git a/mbfido/tosspkt.c b/mbfido/tosspkt.c index 5a4c3be2..15f4075c 100644 --- a/mbfido/tosspkt.c +++ b/mbfido/tosspkt.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: tosspkt.c,v 1.28 2006/06/05 10:12:27 mbse Exp $ * Purpose ...............: Toss a single *.pkt file * ***************************************************************************** - * Copyright (C) 1997-2005 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -141,7 +140,7 @@ int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t int flags, int cost, FILE *fp, unsigned int tzone) { char *buf, *marea = NULL; - int echomail = FALSE, rc = 0, bad = 0, Known = FALSE, FirstLine, size = 0; + int echomail = FALSE, rc = 0, bad = 0, FirstLine, size = 0; sysconnect Link; if (CFG.slow_util && do_quiet) @@ -160,7 +159,6 @@ int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t StatAdd(&nodes.MailRcvd, 1); UpdateNode(); SearchNode(Link.aka); - Known = TRUE; } buf = calloc(MAX_LINE_LENGTH +1, sizeof(char)); diff --git a/mbmon/mbmon.c b/mbmon/mbmon.c index 2439b656..dd5cd823 100644 --- a/mbmon/mbmon.c +++ b/mbmon/mbmon.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: mbmon.c,v 1.59 2007/09/02 11:17:32 mbse Exp $ * Purpose ...............: Monitor Program * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -80,7 +79,7 @@ static void die(int onsig) void ShowSysinfo(void) { int ch; - char buf[128], *cnt, *lc; + char buf[128], *lc; clr_index(); set_color(WHITE, BLACK); @@ -103,7 +102,7 @@ void ShowSysinfo(void) if (socket_send(buf) == 0) { snprintf(buf, 128, "%s", socket_receive()); if (strncmp(buf, "100:7,", 6) == 0) { - cnt = strtok(buf, ","); + strtok(buf, ","); mbse_mvprintw( 7,26, "%s", strtok(NULL, ",")); mbse_mvprintw( 8,26, "%s", strtok(NULL, ",")); mbse_mvprintw( 9,26, "%s", strtok(NULL, ",")); @@ -125,7 +124,7 @@ void ShowSysinfo(void) void ShowLastcaller(void) { int records, maxrows, ch, i, y, o; - char buf[128], *cnt; + char buf[128]; clr_index(); set_color(WHITE, BLACK); @@ -144,7 +143,7 @@ void ShowLastcaller(void) if (socket_send(buf) == 0) { snprintf(buf, 128, "%s", socket_receive()); if (strncmp(buf, "100:1,", 6) == 0) { - cnt = strtok(buf, ","); + strtok(buf, ","); records = atoi(strtok(NULL, ";")); } } @@ -161,7 +160,7 @@ void ShowLastcaller(void) if (socket_send(buf) == 0) { snprintf(buf, 128, "%s", socket_receive()); if (strncmp(buf, "100:9,", 6) == 0) { - cnt = strtok(buf, ","); + strtok(buf, ","); mbse_mvprintw(y, 1, "%2d", i); mbse_mvprintw(y, 4, "%s", cldecode(strtok(NULL, ","))); mbse_mvprintw(y,19, "%s", cldecode(strtok(NULL, ","))); @@ -186,7 +185,7 @@ void ShowLastcaller(void) void system_moni(void) { int ch, y, eof; - char *cnt, buf[128]; + char buf[128]; time_t start, now; clr_index(); @@ -220,7 +219,7 @@ void system_moni(void) */ eof = 1; } else { - cnt = strtok(buf, ","); + strtok(buf, ","); mbse_mvprintw(y, 1, (char *)"%.5s", strtok(NULL, ",")); mbse_mvprintw(y, 7, (char *)"%.6s", strtok(NULL, ",")); mbse_mvprintw(y,14, (char *)"%.8s", cldecode(strtok(NULL, ","))); @@ -250,7 +249,7 @@ void system_moni(void) void system_stat(void) { int ch; - char buf[256], *cnt; + char buf[256]; time_t now; clr_index(); @@ -289,12 +288,12 @@ void system_stat(void) if (socket_send(buf) == 0) { strncpy(buf, socket_receive(), 256); set_color(LIGHTGRAY, BLACK); - cnt = strtok(buf, ","); + strtok(buf, ","); now = atoi(strtok(NULL, ",")); mbse_mvprintw(7, 30, "%s", ctime(&now)); now = atoi(strtok(NULL, ",")); mbse_mvprintw(8, 30, "%s", ctime(&now)); - cnt = strtok(NULL, ","); + strtok(NULL, ","); mbse_mvprintw(9, 30, (char *)"%s ", strtok(NULL, ",")); mbse_mvprintw(10,30, (char *)"%s ", strtok(NULL, ",")); mbse_mvprintw(14,30, (char *)"%s ", strtok(NULL, ",")); diff --git a/mbnntp/rfc2ftn.c b/mbnntp/rfc2ftn.c index 4540ac9b..41f6876c 100644 --- a/mbnntp/rfc2ftn.c +++ b/mbnntp/rfc2ftn.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: rfc2ftn.c,v 1.19 2008/08/31 21:10:51 mbse Exp $ * Purpose ...............: Convert RFC to FTN * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -168,7 +167,6 @@ int rfc2ftn(FILE *fp) FILE *ofp, *qfp; fa_list *sbl = NULL, *ptl = NULL, *tmpl; faddr *ta, *fta; - unsigned int svmsgid, svreply; int sot_kludge = FALSE, eot_kludge = FALSE, tinyorigin = FALSE; int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders; time_t Now; @@ -193,8 +191,6 @@ int rfc2ftn(FILE *fp) } fmsg->area = xstrcpy(msgs.Tag); - svmsgid = fmsg->msgid_n; - svreply = fmsg->reply_n; if ((p = hdr((char *)"Message-ID",msg))) { ftnmsgid(p, &fmsg->msgid_a, &fmsg->msgid_n, fmsg->area); hash_update_s(&fmsg->msgid_n, fmsg->area); diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index fd4b6882..465136cb 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: filesub.c,v 1.51 2008/02/17 18:46:38 mbse Exp $ * Purpose ...............: All the file sub functions. * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -773,7 +772,7 @@ int ImportFile(char *fn, int Area, int fileid, off_t Size) int Addfile(char *File, int AreaNum, int fileid) { FILE *id, *pPrivate; - int iDesc = 1, iPrivate = FALSE, GotId = FALSE, lines, i, j; + int iDesc = 1, GotId = FALSE, lines, i, j; char *Filename, *temp1, *idname = NULL, *Desc[26], *lname, temp[PATH_MAX], msg[81]; struct stat statfile; struct _fdbarea *fdb_area = NULL; @@ -980,7 +979,6 @@ int Addfile(char *File, int AreaNum, int fileid) if ((pPrivate = fopen(temp, "a+")) == NULL) WriteError("$Can't open %s", temp); else { - iPrivate = TRUE; fprintf(pPrivate, "****************************************************"); fprintf(pPrivate, "\nUser : %s", fdb.Uploader); fprintf(pPrivate, "\nFile : %s (%s)", fdb.LName, fdb.Name); diff --git a/mbsebbs/menu.c b/mbsebbs/menu.c index 772a3df4..55879fc3 100644 --- a/mbsebbs/menu.c +++ b/mbsebbs/menu.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: menu.c,v 1.38 2007/02/25 20:28:10 mbse Exp $ * Purpose ...............: Display and handle the menus. * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -89,7 +88,7 @@ void InitMenu() void menu() { FILE *pMenuFile; - int iFoundKey = FALSE, Key, IsANSI; + int Key, IsANSI; char temp[81], *Input, *sMenuPathFileName, buf[81]; Input = calloc(PATH_MAX, sizeof(char)); @@ -236,7 +235,6 @@ void menu() fclose(pMenuFile); } DoMenu(le_int(menus.MenuType)); - iFoundKey = TRUE; break; } } diff --git a/mbsebbs/newuser.c b/mbsebbs/newuser.c index d535f331..209ff6cb 100644 --- a/mbsebbs/newuser.c +++ b/mbsebbs/newuser.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * $Id: newuser.c,v 1.39 2008/11/26 21:55:25 mbse Exp $ * Purpose ...............: New User login under Unix, creates both * BBS and unix accounts. * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -77,7 +76,6 @@ int newuser(void) { FILE *pUsrConfig; int i, x, Found, iLang, recno = 0, Count = 0, badname; - unsigned int crc; char temp[PATH_MAX], *FullName, *temp1, *temp2, *Phone1, *Phone2; int offset; struct userrec us; @@ -171,7 +169,6 @@ int newuser(void) language(LIGHTRED, BLACK, 41); Enter(1); } else { - crc = StringCRC32(tu(temp1)); break; } } else { diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index f984992e..ab5eeb58 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: offline.c,v 1.61 2008/02/12 19:59:45 mbse Exp $ * Purpose ...............: Offline Reader * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -2659,8 +2658,6 @@ char *StripSpaces(char *String, int Size) void OLR_DownASCII(void) { - struct tm *tp; - time_t Now; char Pktname[32], *Work, *Temp, *cwd = NULL, Atag[60], Kinds[12], *p; int Area = 0, i, rc = 0; FILE *fp = NULL, *tf, *mf, *af, *inf; @@ -2685,8 +2682,6 @@ void OLR_DownASCII(void) Work = calloc(PATH_MAX, sizeof(char)); Temp = calloc(PATH_MAX, sizeof(char)); - Now = time(NULL); - tp = localtime(&Now); Syslog('+', "Preparing ASCII packet"); snprintf(Temp, PATH_MAX, "%s.MSG", CFG.bbsid); diff --git a/mbsebbs/ttyio.c b/mbsebbs/ttyio.c index 72895173..6b8d9ac5 100644 --- a/mbsebbs/ttyio.c +++ b/mbsebbs/ttyio.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: ttyio.c,v 1.4 2006/03/20 19:13:14 mbse Exp $ * Purpose ...............: tty I/O for mbsebbs and mbnewusr * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -61,7 +60,6 @@ char *ttystat[]= {(char *)"Ok", static int tty_read(char *, int, int); static int tty_read(char *buf, int size, int tot) { - time_t now; int rc; fd_set readfds, writefds, exceptfds; struct timeval seltimer; @@ -70,8 +68,6 @@ static int tty_read(char *buf, int size, int tot) return 0; tty_status = 0; - now = time(NULL); - FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); diff --git a/mbsebbs/whoson.c b/mbsebbs/whoson.c index 022d50b5..7a23f963 100644 --- a/mbsebbs/whoson.c +++ b/mbsebbs/whoson.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: whoson.c,v 1.19 2007/02/25 20:28:13 mbse Exp $ * Purpose ...............: Who's online functions * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -50,7 +49,7 @@ extern int LC_Download, LC_Upload, LC_Read, LC_Chat, LC_Olr, LC_Door; */ void WhosOn(char *OpData) { - char buf[128], *Heading, *cnt, *isdoing, *location, *device; + char buf[128], *Heading, *isdoing, *location, *device; char *fullname, *temp, msg[81], wstr[128];; int x, Start = TRUE; FILE *fp; @@ -100,7 +99,7 @@ void WhosOn(char *OpData) /* * We are only interested in copies of the mbsebbs program */ - cnt = strtok(buf, ","); + strtok(buf, ","); strtok(NULL, ","); device = xstrcpy(strtok(NULL, ",")); fullname = xstrcpy(cldecode(strtok(NULL, ","))); diff --git a/mbsebbs/zmsend.c b/mbsebbs/zmsend.c index 69709bf1..fc42b967 100644 --- a/mbsebbs/zmsend.c +++ b/mbsebbs/zmsend.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: zmsend.c,v 1.23 2006/03/20 19:13:14 mbse Exp $ * Purpose ...............: Zmodem sender * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -205,14 +204,9 @@ static int sendzfile(char *rn) { int rc = 0; struct stat st; - struct flock fl; int bufl; int sverr; - fl.l_type = F_RDLCK; - fl.l_whence = 0; - fl.l_start = 0L; - fl.l_len = 0L; if (txbuf == NULL) txbuf = malloc(MAXBLOCK + 1024); diff --git a/mbsetup/ledit.c b/mbsetup/ledit.c index 333af374..a783214c 100644 --- a/mbsetup/ledit.c +++ b/mbsetup/ledit.c @@ -3,7 +3,7 @@ * Purpose ...............: Line Editor * ***************************************************************************** - * Copyright (C) 1997-2010 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -68,7 +68,6 @@ int yes_no(char *T_) void errmsg(const char *format, ...) { char *t; - int ch; va_list va_ptr; t = calloc(256, sizeof(char)); @@ -83,7 +82,7 @@ void errmsg(const char *format, ...) clrtoeol(); mbse_mvprintw(LINES - 3, 6, t); putchar(7); - ch = readkey(LINES - 3, strlen(t) + 6, LIGHTGRAY, BLACK); + readkey(LINES - 3, strlen(t) + 6, LIGHTGRAY, BLACK); mbse_locate(LINES - 3, 6); clrtoeol(); free(t); diff --git a/mbsetup/m_marea.c b/mbsetup/m_marea.c index faa3d000..f270a5d8 100644 --- a/mbsetup/m_marea.c +++ b/mbsetup/m_marea.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: m_marea.c,v 1.58 2007/03/02 15:29:51 mbse Exp $ * Purpose ...............: Message Areas Setup * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -708,7 +707,6 @@ void MsgGlobal(void) fidoaddr a1, a2; int menu = 0, marea, Areas, akan = 0, Found, charset = FTNC_CP437; int Total, Done, netbrd, daysold, maxmsgs, maxarticles; - int offset; securityrec rs, ws, ss, as; sysconnect S, Sc; @@ -865,7 +863,7 @@ void MsgGlobal(void) Total = Done = 0; for (marea = 1; marea <= Areas; marea++) { - offset = LoadMsgRec(marea, FALSE); + LoadMsgRec(marea, FALSE); if (msgs.Active && strlen(msgs.Group)) { for (tmp = mgr; tmp; tmp = tmp->next) { if (tmp->tagged && (strcmp(tmp->group, msgs.Group) == 0)) { @@ -1665,7 +1663,7 @@ char *PickMsgarea(char *shdr) int GroupInMarea(char *Group) { - int Area = 0, RetVal = 0, systems; + int Area = 0, RetVal = 0; FILE *no; char temp[PATH_MAX]; @@ -1676,7 +1674,6 @@ int GroupInMarea(char *Group) fread(&msgshdr, sizeof(msgshdr), 1, no); fseek(no, 0, SEEK_SET); fread(&msgshdr, msgshdr.hdrsize, 1, no); - systems = msgshdr.syssize / sizeof(sysconnect); while (fread(&msgs, msgshdr.recsize, 1, no) == 1) { Area++; diff --git a/mbsetup/m_ticarea.c b/mbsetup/m_ticarea.c index 67f5b33d..dc6fcf67 100644 --- a/mbsetup/m_ticarea.c +++ b/mbsetup/m_ticarea.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: m_ticarea.c,v 1.29 2006/02/24 20:33:28 mbse Exp $ * Purpose ...............: TIC Areas Setup Program * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -557,7 +556,6 @@ void TicGlobal(void) fidoaddr a1, a2; int menu = 0, areanr, Areas, akan = 0, Found; int Total, Done; - int offset; sysconnect S, Sc; securityrec as; @@ -659,7 +657,7 @@ void TicGlobal(void) Total = Done = 0; for (areanr = 1; areanr <= Areas; areanr++) { - offset = LoadTicRec(areanr, FALSE); + LoadTicRec(areanr, FALSE); if (tic.Active && strlen(tic.Group)) { for (tmp = mgr; tmp; tmp = tmp->next) { if (tmp->tagged && (strcmp(tmp->group, tic.Group) == 0)) { @@ -1199,7 +1197,7 @@ int GroupInTic(char *Group) { char temp[PATH_MAX]; FILE *no; - int systems, Area = 0, RetVal = 0; + int Area = 0, RetVal = 0; snprintf(temp, PATH_MAX, "%s/etc/tic.data", getenv("MBSE_ROOT")); if ((no = fopen(temp, "r")) == NULL) @@ -1208,7 +1206,6 @@ int GroupInTic(char *Group) fread(&tichdr, sizeof(tichdr), 1, no); fseek(no, 0, SEEK_SET); fread(&tichdr, tichdr.hdrsize, 1, no); - systems = tichdr.syssize / sizeof(sysconnect); while ((fread(&tic, tichdr.recsize, 1, no)) == 1) { Area++; diff --git a/mbtask/ports.c b/mbtask/ports.c index 4adf2031..cb5001dc 100644 --- a/mbtask/ports.c +++ b/mbtask/ports.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: ports.c,v 1.19 2006/05/22 12:09:15 mbse Exp $ * Purpose ...............: mbtask - mode portlists * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -112,7 +111,6 @@ void load_ports() { FILE *fp; pp_list new; - int stdflag; char *p, *q, *capflags = NULL; nodelist_modem **tmpm; @@ -137,14 +135,11 @@ void load_ports() strncpy(new.tty, ttyinfo.tty, 6); capflags = xstrcpy((char *)"flags:"); - stdflag = TRUE; q = xstrcpy(ttyinfo.flags); for (p = q; p; p = q) { if ((q = strchr(p, ','))) *q++ = '\0'; - if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) { - stdflag = FALSE; - } else { + if (strncasecmp(p, "U", 1) || (strlen(p) != 1)) { for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next)) if (strcasecmp(p, (*tmpm)->name) == 0) { new.mflags |= (*tmpm)->value; diff --git a/mbtask/taskcomm.c b/mbtask/taskcomm.c index 464f814f..b678d65f 100644 --- a/mbtask/taskcomm.c +++ b/mbtask/taskcomm.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: taskcomm.c,v 1.43 2008/02/10 19:31:11 mbse Exp $ * Purpose ...............: MBSE BBS Daemon * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -86,7 +85,7 @@ char *exe_cmd(char *in) static char cmd[4]; static char token[SS_BUFSIZE]; static char ebuf[19]; - static char *cnt, var1[16]; + static char var1[16]; int result; char *buf; @@ -481,7 +480,7 @@ char *exe_cmd(char *in) * 100:0; */ if (strncmp(cmd, "GMON", 4) == 0) { - cnt = strtok(token, ","); + strtok(token, ","); strcpy(var1, strtok(NULL, ";")); buf = calloc(SS_BUFSIZE, sizeof(char)); get_reginfo_r(atoi(var1), buf); @@ -521,7 +520,7 @@ char *exe_cmd(char *in) * 201:1,16; */ if (strncmp(cmd, "GLCR", 4) == 0) { - cnt = strtok(token, ","); + strtok(token, ","); strcpy(var1, strtok(NULL, ";")); buf = calloc(SS_BUFSIZE, sizeof(char)); get_lastcallerrec_r(atoi(var1), buf); diff --git a/mbtask/taskstat.c b/mbtask/taskstat.c index e7d9901b..821d0b33 100644 --- a/mbtask/taskstat.c +++ b/mbtask/taskstat.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: taskstat.c,v 1.35 2008/02/10 13:29:42 mbse Exp $ * Purpose ...............: Keep track of server status * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -443,11 +442,11 @@ int sem_set(char *sem, int value) void sem_status_r(char *data, char *buf) { - char *cnt, *sem; + char *sem; int value; snprintf(buf, 40, "200:1,16;"); - cnt = strtok(data, ","); + strtok(data, ","); sem = strtok(NULL, ";"); if (!strcmp(sem, "scanout")) { diff --git a/mbtask/taskutil.c b/mbtask/taskutil.c index ec3baf93..0a0ea41d 100644 --- a/mbtask/taskutil.c +++ b/mbtask/taskutil.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: taskutil.c,v 1.32 2007/02/26 21:02:31 mbse Exp $ * Purpose ...............: MBSE BBS Task Manager, utilities * ***************************************************************************** - * Copyright (C) 1997-2006 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -356,7 +355,7 @@ int file_exist(char *path, int mode) int mkdirs(char *name, mode_t mode) { char buf[PATH_MAX], *p, *q; - int rc, last = 0, oldmask; + int last = 0, oldmask; memset(&buf, 0, sizeof(buf)); strncpy(buf, name, sizeof(buf)-1); @@ -367,7 +366,7 @@ int mkdirs(char *name, mode_t mode) oldmask = umask(000); while ((q = strchr(p, '/'))) { *q = '\0'; - rc = mkdir(buf, mode); + mkdir(buf, mode); last = errno; *q = '/'; p = q+1; diff --git a/mbutils/mbsnmp.c b/mbutils/mbsnmp.c index 2971a83a..64a918cd 100644 --- a/mbutils/mbsnmp.c +++ b/mbutils/mbsnmp.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: mbsnmp.c,v 1.3 2008/02/23 21:42:17 mbse Exp $ * Purpose ...............: SNMP passthru support. * ***************************************************************************** - * Copyright (C) 1997-2008 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -90,7 +89,7 @@ int main(int argc, char **argv) { int i, getnext = FALSE, group = 0, sub = 0, params, val = 0; char *t1, *t2, *saveptr1 = NULL, *saveptr2 = NULL, *token1, *token2; - char *base_save, *req_save, *envptr = NULL, *req_oid, *base_oid, *resp, *type; + char *base_save, *envptr = NULL, *req_oid, *base_oid, *resp, *type; struct passwd *pw; /* @@ -136,7 +135,6 @@ int main(int argc, char **argv) CFG.util_loglevel, CFG.error_log, CFG.mgrlog, CFG.debuglog); base_save = xstrcpy(base_oid); - req_save = xstrcpy(req_oid); for (i = 1, t1 = base_oid, t2 = req_oid; ; i++, t1 = NULL, t2 = NULL) { token1 = strtok_r(t1, ".", &saveptr1); token2 = strtok_r(t2, ".", &saveptr2); diff --git a/mbutils/mbuser.c b/mbutils/mbuser.c index 8d9508de..f510acef 100644 --- a/mbutils/mbuser.c +++ b/mbutils/mbuser.c @@ -1,10 +1,9 @@ /***************************************************************************** * - * $Id: mbuser.c,v 1.5 2007/02/11 13:19:37 mbse Exp $ * Purpose ...............: User Pack Util * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -175,8 +174,8 @@ void UserPack(int days, int level, int pack) { FILE *fin, *fout; char *fnin, *fnout, *cmd; - int oldsize, curpos; - int updated, delete = 0, rc, highest = 0, record = 0, sysop = FALSE; + int oldsize; + int updated, delete = 0, highest = 0, record = 0, sysop = FALSE; time_t Last; fnin = calloc(PATH_MAX, sizeof(char)); @@ -258,7 +257,6 @@ void UserPack(int days, int level, int pack) */ if (days && level) { fseek(fout, sizeof(usrhdr), SEEK_SET); - curpos = sizeof(usrhdr); while (fread(&usr, sizeof(usr), 1, fout) == 1) { /* @@ -318,22 +316,22 @@ void UserPack(int days, int level, int pack) WriteError("Cannot delete unix account %s", usr.Name); } else { #ifndef __FreeBSD__ - rc = execute_str((char *)"/usr/sbin/userdel ", usr.Name, NULL, + execute_str((char *)"/usr/sbin/userdel ", usr.Name, NULL, (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); #else - rc = execute_str((char *)"/usr/sbin/pw userdel ", usr.Name, NULL, + execute_str((char *)"/usr/sbin/pw userdel ", usr.Name, NULL, (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); #endif #ifdef _VPOPMAIL_PATH cmd = xstrcpy((char *)_VPOPMAIL_PATH); cmd = xstrcat(cmd, (char *)"/vdeluser "); - rc = execute_str(cmd, usr.Name, NULL, (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); + execute_str(cmd, usr.Name, NULL, (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); free(cmd); #endif if (chdir(CFG.bbs_usersdir) == 0) { cmd = xstrcpy((char *)"-Rf "); cmd = xstrcat(cmd, usr.Name); - rc = execute_pth((char *)"rm", cmd, (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); + execute_pth((char *)"rm", cmd, (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); free(cmd); } } diff --git a/script/init.Arch b/script/init.Arch new file mode 100644 index 00000000..bdd48d1c --- /dev/null +++ b/script/init.Arch @@ -0,0 +1,61 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +MBSE_ROOT=`cat /etc/passwd | grep ^mbse: | awk -F ':' '{ print $6}'` +export MBSE_ROOT + +case "$1" in +start) + stat_busy "Starting MBSE BBS" + rm -f ${MBSE_ROOT}/var/run/* + rm -f ${MBSE_ROOT}/var/sema/* + rm -f ${MBSE_ROOT}/var/*.LCK + rm -f ${MBSE_ROOT}/tmp/mb* + su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null + add_daemon mbtask + sleep 2 + if [ -f ${MBSE_ROOT}/etc/config.data ]; then + su mbse -c '${MBSE_ROOT}/bin/mbstat open -quiet' + stat_done + else + stat_fail + exit 1 + fi + ;; +stop) + stat_busy "Stopping MBSE BBS" + if [ -f ${MBSE_ROOT}/var/run/mbtask ]; then + stat_append "logoff users" + su mbse -c '${MBSE_ROOT}/bin/mbstat close wait -quiet' >/dev/null + stat_append " done, stopping mbtask" + kill -15 `cat ${MBSE_ROOT}/var/run/mbtask` + i=10; doit=1; + while let 'i > 0' && let 'doit != 0' + do + if [ -f ${MBSE_ROOT}/var/run/mbtask ]; then + stat_append "." + sleep 1 + let i=i-1 + else + doit=0 + fi + done + if [ -f ${MBSE_ROOT}/var/run/mbtask ]; then + kill -9 `cat ${MBSE_ROOT}/var/run/mbtask` + fi + fi + rm_daemon mbtask + stat_done + ;; +restart) + $0 stop + sleep 1 + $0 start + ;; +*) + echo "usage: $0 {start|stop|restart}" + ;; +esac +exit 0 diff --git a/script/installinit.sh b/script/installinit.sh index 27153165..2756fc32 100644 --- a/script/installinit.sh +++ b/script/installinit.sh @@ -1,6 +1,4 @@ # -# $Id: installinit.sh,v 1.22 2008/11/18 21:03:08 mbse Exp $ -# # Installation script to install bootscripts. # PATH=/bin:/sbin:/usr/bin:/usr/sbin:${MBSE_ROOT}/bin @@ -87,6 +85,10 @@ if [ "$OSTYPE" = "Linux" ]; then elif [ -f /etc/gentoo-release ]; then DISTNAME="Gentoo" DISTVERS=`cat /etc/gentoo-release | awk '{ print $5 }'` + elif [ -f /etc/arch-release ]; then + DISTNAME="Arch Linux" + # No version, this is a rolling release system + DISTVERS="N/A" else DISTNAME="Unknown" log "!" "unknown distribution, collecting data" @@ -300,6 +302,20 @@ if [ "$DISTNAME" = "Gentoo" ]; then fi +#-------------------------------------------------------------------------- +# +# Adding scripts for Arch Linux +# +# +if [ "$DISTNAME" = "Arch Linux" ]; then + echo "You are running Arch Linux" + log "+" "Adding Arch Linux init script" + DISTINIT="/etc/rc.d/mbsebbs" + + +fi + + #-------------------------------------------------------------------------- # # Adding scripts for NetBSD diff --git a/unix/mbpasswd.c b/unix/mbpasswd.c index 942a180b..c97ef3e4 100644 --- a/unix/mbpasswd.c +++ b/unix/mbpasswd.c @@ -1,11 +1,10 @@ /***************************************************************************** * - * $Id: mbpasswd.c,v 1.20 2007/05/28 10:40:24 mbse Exp $ * Purpose ...............: setuid root version of passwd * Shadow Suite (c) ......: Julianne Frances Haugh * ***************************************************************************** - * Copyright (C) 1997-2007 + * Copyright (C) 1997-2011 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -847,7 +846,6 @@ int main(int argc, char *argv[]) static struct group *gr; int pfd, tfd; #endif - char *cp; #ifdef _VPOPMAIL_PATH char *args[16]; #endif @@ -1057,11 +1055,8 @@ int main(int argc, char *argv[]) sp = getspnam(name); if (!sp) sp = pwd_to_spwd(pw); - - cp = sp->sp_pwdp; -#else - cp = pw->pw_passwd; #endif + /* * See if the user is permitted to change the password. * Otherwise, go ahead and set a new password.