Secured sprintf with snprintf
This commit is contained in:
parent
35a7bb72d3
commit
22e39869c1
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer - awnser a call
|
* Purpose ...............: Fidonet mailer - awnser a call
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -137,7 +137,7 @@ int answer(char *stype)
|
|||||||
history.inbound = TRUE;
|
history.inbound = TRUE;
|
||||||
|
|
||||||
p = calloc(PATH_MAX, sizeof(char));
|
p = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(p, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
snprintf(p, PATH_MAX -1, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
||||||
if ((fp = fopen(p, "a")) == NULL)
|
if ((fp = fopen(p, "a")) == NULL)
|
||||||
WriteError("$Can't open %s", p);
|
WriteError("$Can't open %s", p);
|
||||||
else {
|
else {
|
||||||
|
@ -486,7 +486,7 @@ SM_STATE(WaitAddr)
|
|||||||
history.aka.net = remote->addr->net;
|
history.aka.net = remote->addr->net;
|
||||||
history.aka.node = remote->addr->node;
|
history.aka.node = remote->addr->node;
|
||||||
history.aka.point = remote->addr->point;
|
history.aka.point = remote->addr->point;
|
||||||
sprintf(history.aka.domain, "%s", printable(remote->addr->domain, 0));
|
snprintf(history.aka.domain, 12, "%s", printable(remote->addr->domain, 0));
|
||||||
|
|
||||||
SM_PROCEED(SendPasswd)
|
SM_PROCEED(SendPasswd)
|
||||||
} else if (bp.rxbuf[0] == MM_BSY) {
|
} else if (bp.rxbuf[0] == MM_BSY) {
|
||||||
@ -787,7 +787,7 @@ SM_STATE(WaitAddr)
|
|||||||
history.aka.net = remote->addr->net;
|
history.aka.net = remote->addr->net;
|
||||||
history.aka.node = remote->addr->node;
|
history.aka.node = remote->addr->node;
|
||||||
history.aka.point = remote->addr->point;
|
history.aka.point = remote->addr->point;
|
||||||
sprintf(history.aka.domain, "%s", printable(remote->addr->domain, 0));
|
snprintf(history.aka.domain, 12, "%s", printable(remote->addr->domain, 0));
|
||||||
|
|
||||||
SM_PROCEED(IsPasswd)
|
SM_PROCEED(IsPasswd)
|
||||||
|
|
||||||
@ -1113,11 +1113,11 @@ TrType binkp_receiver(void)
|
|||||||
|
|
||||||
bp.rmode = CompNone;
|
bp.rmode = CompNone;
|
||||||
if (strlen(bp.rxbuf) < 512) {
|
if (strlen(bp.rxbuf) < 512) {
|
||||||
sprintf(bp.rname, "%s", strtok(bp.rxbuf+1, " \n\r"));
|
snprintf(bp.rname, 511, "%s", strtok(bp.rxbuf+1, " \n\r"));
|
||||||
bp.rsize = atoi(strtok(NULL, " \n\r"));
|
bp.rsize = atoi(strtok(NULL, " \n\r"));
|
||||||
bp.rtime = atoi(strtok(NULL, " \n\r"));
|
bp.rtime = atoi(strtok(NULL, " \n\r"));
|
||||||
bp.roffs = atoi(strtok(NULL, " \n\r"));
|
bp.roffs = atoi(strtok(NULL, " \n\r"));
|
||||||
sprintf(bp.ropts, "%s", printable(strtok(NULL, " \n\r\0"), 0));
|
snprintf(bp.ropts, 511, "%s", printable(strtok(NULL, " \n\r\0"), 0));
|
||||||
if (strcmp((char *)"GZ", bp.ropts) == 0)
|
if (strcmp((char *)"GZ", bp.ropts) == 0)
|
||||||
bp.rmode = CompGZ;
|
bp.rmode = CompGZ;
|
||||||
else if (strcmp((char *)"BZ2", bp.ropts) == 0)
|
else if (strcmp((char *)"BZ2", bp.ropts) == 0)
|
||||||
@ -1871,7 +1871,7 @@ int binkp_send_command(int id, ...)
|
|||||||
fmt = va_arg(args, char*);
|
fmt = va_arg(args, char*);
|
||||||
|
|
||||||
if (fmt) {
|
if (fmt) {
|
||||||
vsprintf(buf, fmt, args);
|
vsnprintf(buf, 1023, fmt, args);
|
||||||
sz = (strlen(buf) & 0x7fff);
|
sz = (strlen(buf) & 0x7fff);
|
||||||
} else {
|
} else {
|
||||||
buf[0]='\0';
|
buf[0]='\0';
|
||||||
@ -2272,11 +2272,11 @@ int binkp_process_messages(void)
|
|||||||
Syslog('+', "Binkp: %s \"%s\"", bstate[tmpq->cmd], printable(tmpq->data, 0));
|
Syslog('+', "Binkp: %s \"%s\"", bstate[tmpq->cmd], printable(tmpq->data, 0));
|
||||||
if (tmpq->cmd == MM_GET) {
|
if (tmpq->cmd == MM_GET) {
|
||||||
rmode = CompNone;
|
rmode = CompNone;
|
||||||
sprintf(lname, "%s", strtok(tmpq->data, " \n\r"));
|
snprintf(lname, 511, "%s", strtok(tmpq->data, " \n\r"));
|
||||||
lsize = atoi(strtok(NULL, " \n\r"));
|
lsize = atoi(strtok(NULL, " \n\r"));
|
||||||
ltime = atoi(strtok(NULL, " \n\r"));
|
ltime = atoi(strtok(NULL, " \n\r"));
|
||||||
loffs = atoi(strtok(NULL, " \n\r"));
|
loffs = atoi(strtok(NULL, " \n\r"));
|
||||||
sprintf(ropts, "%s", strtok(NULL, " \n\r"));
|
snprintf(ropts, 511, "%s", strtok(NULL, " \n\r"));
|
||||||
Syslog('b', "Binkp: m_file options \"%s\"", ropts);
|
Syslog('b', "Binkp: m_file options \"%s\"", ropts);
|
||||||
if (strcmp((char *)"GZ", ropts) == 0)
|
if (strcmp((char *)"GZ", ropts) == 0)
|
||||||
rmode = CompGZ;
|
rmode = CompGZ;
|
||||||
@ -2371,7 +2371,7 @@ int binkp_process_messages(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (tmpq->cmd == MM_GOT) {
|
} else if (tmpq->cmd == MM_GOT) {
|
||||||
sprintf(lname, "%s", strtok(tmpq->data, " \n\r"));
|
snprintf(lname, 511, "%s", strtok(tmpq->data, " \n\r"));
|
||||||
lsize = atoi(strtok(NULL, " \n\r"));
|
lsize = atoi(strtok(NULL, " \n\r"));
|
||||||
ltime = atoi(strtok(NULL, " \n\r"));
|
ltime = atoi(strtok(NULL, " \n\r"));
|
||||||
Found = FALSE;
|
Found = FALSE;
|
||||||
@ -2404,7 +2404,7 @@ int binkp_process_messages(void)
|
|||||||
Syslog('+', "Binkp: unexpected M_GOT \"%s\"", tmpq->data); /* Ignore frame */
|
Syslog('+', "Binkp: unexpected M_GOT \"%s\"", tmpq->data); /* Ignore frame */
|
||||||
}
|
}
|
||||||
} else if (tmpq->cmd == MM_SKIP) {
|
} else if (tmpq->cmd == MM_SKIP) {
|
||||||
sprintf(lname, "%s", strtok(tmpq->data, " \n\r"));
|
snprintf(lname, 511, "%s", strtok(tmpq->data, " \n\r"));
|
||||||
lsize = atoi(strtok(NULL, " \n\r"));
|
lsize = atoi(strtok(NULL, " \n\r"));
|
||||||
ltime = atoi(strtok(NULL, " \n\r"));
|
ltime = atoi(strtok(NULL, " \n\r"));
|
||||||
Found = FALSE;
|
Found = FALSE;
|
||||||
@ -2508,9 +2508,9 @@ char *unix2binkp(char *fn)
|
|||||||
*q = '\0';
|
*q = '\0';
|
||||||
} else {
|
} else {
|
||||||
if (nodes.WrongEscape) {
|
if (nodes.WrongEscape) {
|
||||||
sprintf(q, "\\%2x", p[0]);
|
snprintf(q, 4, "\\%2x", p[0]);
|
||||||
} else {
|
} else {
|
||||||
sprintf(q, "\\x%2x", p[0]);
|
snprintf(q, 5, "\\x%2x", p[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (*q)
|
while (*q)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -147,7 +147,7 @@ int call(faddr *addr)
|
|||||||
history.aka.node = addr->node;
|
history.aka.node = addr->node;
|
||||||
history.aka.point = addr->point;
|
history.aka.point = addr->point;
|
||||||
if (addr->domain && strlen(addr->domain))
|
if (addr->domain && strlen(addr->domain))
|
||||||
sprintf(history.aka.domain, "%s", printable(addr->domain, 0));
|
snprintf(history.aka.domain, 12, "%s", printable(addr->domain, 0));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Extract the protocol from the URL.
|
* Extract the protocol from the URL.
|
||||||
|
@ -102,12 +102,12 @@ int send_str(char *str, char *Phone)
|
|||||||
case 'p': msleep(250); *q++ = '\\'; *q++ = 'p'; break;
|
case 'p': msleep(250); *q++ = '\\'; *q++ = 'p'; break;
|
||||||
case 'D': if (Phone) {
|
case 'D': if (Phone) {
|
||||||
PUTSTR(Phone);
|
PUTSTR(Phone);
|
||||||
sprintf(q, "%s", Phone);
|
snprintf(q, 20, "%s", Phone);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'T': if (Phone) {
|
case 'T': if (Phone) {
|
||||||
PUTSTR(tranphone(Phone));
|
PUTSTR(tranphone(Phone));
|
||||||
sprintf(q, "%s", tranphone(Phone));
|
snprintf(q, 20, "%s", tranphone(Phone));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: PUTCHAR(*p); *q++ = *p; break;
|
default: PUTCHAR(*p); *q++ = *p; break;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -126,8 +126,8 @@ int hangup()
|
|||||||
history.sent_bytes = sentbytes;
|
history.sent_bytes = sentbytes;
|
||||||
history.rcvd_bytes = rcvdbytes;
|
history.rcvd_bytes = rcvdbytes;
|
||||||
history.inbound = ~master;
|
history.inbound = ~master;
|
||||||
tmp = calloc(128, sizeof(char));
|
tmp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(tmp, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
snprintf(tmp, PATH_MAX -1, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
||||||
if ((fp = fopen(tmp, "a")) == NULL)
|
if ((fp = fopen(tmp, "a")) == NULL)
|
||||||
WriteError("$Can't open %s", tmp);
|
WriteError("$Can't open %s", tmp);
|
||||||
else {
|
else {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -523,7 +523,7 @@ SM_STATE(senddata)
|
|||||||
PUTCHAR('*');
|
PUTCHAR('*');
|
||||||
PUTCHAR('*');
|
PUTCHAR('*');
|
||||||
PUTSTR(p);
|
PUTSTR(p);
|
||||||
sprintf(trailer, "%04X\r\021", crc16xmodem(p, strlen(p)));
|
snprintf(trailer, 7, "%04X\r\021", crc16xmodem(p, strlen(p)));
|
||||||
PUTSTR(trailer);
|
PUTSTR(trailer);
|
||||||
Syslog('i', "TXEMSI: send **%s%04X", p, crc16xmodem(p, strlen(p)));
|
Syslog('i', "TXEMSI: send **%s%04X", p, crc16xmodem(p, strlen(p)));
|
||||||
free(p);
|
free(p);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -204,7 +204,7 @@ char *mkemsidat(int caller)
|
|||||||
else
|
else
|
||||||
p=xstrcat(p,(char *)"}");
|
p=xstrcat(p,(char *)"}");
|
||||||
|
|
||||||
sprintf(cbuf,"{%X}",PRODCODE);
|
snprintf(cbuf,15,"{%X}",PRODCODE);
|
||||||
p=xstrcat(p,cbuf);
|
p=xstrcat(p,cbuf);
|
||||||
p=xstrcat(p,(char *)"{mbcico}{");
|
p=xstrcat(p,(char *)"{mbcico}{");
|
||||||
p=xstrcat(p,(char *)VERSION);
|
p=xstrcat(p,(char *)VERSION);
|
||||||
@ -220,7 +220,7 @@ char *mkemsidat(int caller)
|
|||||||
p=xstrcat(p,phone?emsiencode(phone):(char *)"-Unpublished-");
|
p=xstrcat(p,phone?emsiencode(phone):(char *)"-Unpublished-");
|
||||||
p=xstrcat(p,(char *)"][");
|
p=xstrcat(p,(char *)"][");
|
||||||
if ((CFG.IP_Speed) && (emsi_local_protos & PROT_TCP))
|
if ((CFG.IP_Speed) && (emsi_local_protos & PROT_TCP))
|
||||||
sprintf(cbuf,"%ld",CFG.IP_Speed);
|
snprintf(cbuf,15,"%ld",CFG.IP_Speed);
|
||||||
else
|
else
|
||||||
strcpy(cbuf,"9600");
|
strcpy(cbuf,"9600");
|
||||||
p=xstrcat(p,cbuf);
|
p=xstrcat(p,cbuf);
|
||||||
@ -228,13 +228,13 @@ char *mkemsidat(int caller)
|
|||||||
p=xstrcat(p,flags?emsiencode(flags):(char *)"");
|
p=xstrcat(p,flags?emsiencode(flags):(char *)"");
|
||||||
p=xstrcat(p,(char *)"]}{TRX#}{[");
|
p=xstrcat(p,(char *)"]}{TRX#}{[");
|
||||||
tt = time(NULL);
|
tt = time(NULL);
|
||||||
sprintf(cbuf,"%08lX", (unsigned long)mtime2sl(tt));
|
snprintf(cbuf,15,"%08lX", (unsigned long)mtime2sl(tt));
|
||||||
p=xstrcat(p,cbuf);
|
p=xstrcat(p,cbuf);
|
||||||
p=xstrcat(p,(char *)"]}{TZUTC}{[");
|
p=xstrcat(p,(char *)"]}{TZUTC}{[");
|
||||||
p=xstrcat(p,gmtoffset(tt));
|
p=xstrcat(p,gmtoffset(tt));
|
||||||
p=xstrcat(p,(char *)"]}");
|
p=xstrcat(p,(char *)"]}");
|
||||||
|
|
||||||
sprintf(cbuf,"%04X",(unsigned int)strlen(p+12));
|
snprintf(cbuf,15,"%04X",(unsigned int)strlen(p+12));
|
||||||
memcpy(p+8,cbuf,4);
|
memcpy(p+8,cbuf,4);
|
||||||
emsiencode(NULL); /* Free memory */
|
emsiencode(NULL); /* Free memory */
|
||||||
return p;
|
return p;
|
||||||
@ -396,7 +396,7 @@ int scanemsidat(char *buf)
|
|||||||
history.aka.net = remote->addr->net;
|
history.aka.net = remote->addr->net;
|
||||||
history.aka.node = remote->addr->node;
|
history.aka.node = remote->addr->node;
|
||||||
history.aka.point = remote->addr->point;
|
history.aka.point = remote->addr->point;
|
||||||
sprintf(history.aka.domain, "%s", printable(remote->addr->domain, 0));
|
snprintf(history.aka.domain, 12, "%s", printable(remote->addr->domain, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (emsi_remote_password)
|
if (emsi_remote_password)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: fidonet mailer
|
* Purpose ...............: fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -53,7 +53,7 @@ static char *tmpkname(void)
|
|||||||
{
|
{
|
||||||
static char buf[16];
|
static char buf[16];
|
||||||
|
|
||||||
sprintf(buf,"%08lx.pkt", sequencer());
|
snprintf(buf,15,"%08lx.pkt", sequencer());
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ void check_filebox(char *boxpath, file_list **st)
|
|||||||
pw = getpwnam((char *)"mbse");
|
pw = getpwnam((char *)"mbse");
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
||||||
sprintf(temp, "%s/%s", boxpath, de->d_name);
|
snprintf(temp, PATH_MAX -1, "%s/%s", boxpath, de->d_name);
|
||||||
if (stat(temp, &stbuf) == 0) {
|
if (stat(temp, &stbuf) == 0) {
|
||||||
Syslog('o' ,"checking file \"%s\"", de->d_name);
|
Syslog('o' ,"checking file \"%s\"", de->d_name);
|
||||||
if (S_ISREG(stbuf.st_mode)) {
|
if (S_ISREG(stbuf.st_mode)) {
|
||||||
@ -360,7 +360,7 @@ file_list *create_filelist(fa_list *al, char *fl, int create)
|
|||||||
*/
|
*/
|
||||||
nm = reqname(tmpa->addr);
|
nm = reqname(tmpa->addr);
|
||||||
if ((nm != NULL) && (stat(nm, &stbuf) == 0)) {
|
if ((nm != NULL) && (stat(nm, &stbuf) == 0)) {
|
||||||
sprintf(tmpreq, "%04X%04X.REQ", tmpa->addr->net, tmpa->addr->node);
|
snprintf(tmpreq, 12, "%04X%04X.REQ", tmpa->addr->net, tmpa->addr->node);
|
||||||
add_list(&st, nm, tmpreq, DSF, 0L, NULL, 1);
|
add_list(&st, nm, tmpreq, DSF, 0L, NULL, 1);
|
||||||
made_request = 1;
|
made_request = 1;
|
||||||
}
|
}
|
||||||
@ -375,7 +375,7 @@ file_list *create_filelist(fa_list *al, char *fl, int create)
|
|||||||
Syslog('o', "Checking T-Mail short box \"%s\"", CFG.tmailshort);
|
Syslog('o', "Checking T-Mail short box \"%s\"", CFG.tmailshort);
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
||||||
sprintf(temp, "%s/%s", CFG.tmailshort, de->d_name);
|
snprintf(temp, PATH_MAX -1, "%s/%s", CFG.tmailshort, de->d_name);
|
||||||
if (stat(temp, &sb) == 0) {
|
if (stat(temp, &sb) == 0) {
|
||||||
Syslog('o' ,"checking \"%s\"", de->d_name);
|
Syslog('o' ,"checking \"%s\"", de->d_name);
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
if (S_ISDIR(sb.st_mode)) {
|
||||||
@ -441,13 +441,13 @@ file_list *create_filelist(fa_list *al, char *fl, int create)
|
|||||||
Syslog('o', "Checking T-Mail long box \"%s\"", CFG.tmaillong);
|
Syslog('o', "Checking T-Mail long box \"%s\"", CFG.tmaillong);
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
||||||
sprintf(temp, "%s/%s", CFG.tmaillong, de->d_name);
|
snprintf(temp, PATH_MAX -1, "%s/%s", CFG.tmaillong, de->d_name);
|
||||||
if (stat(temp, &sb) == 0) {
|
if (stat(temp, &sb) == 0) {
|
||||||
Syslog('o' ,"checking \"%s\"", de->d_name);
|
Syslog('o' ,"checking \"%s\"", de->d_name);
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
if (S_ISDIR(sb.st_mode)) {
|
||||||
char c, d;
|
char c, d;
|
||||||
int n;
|
int n;
|
||||||
sprintf(temp2, "%s", de->d_name);
|
snprintf(temp2, PATH_MAX -1, "%s", de->d_name);
|
||||||
fa = (faddr*)malloc(sizeof(faddr));
|
fa = (faddr*)malloc(sizeof(faddr));
|
||||||
fa->name = NULL;
|
fa->name = NULL;
|
||||||
fa->domain = NULL;
|
fa->domain = NULL;
|
||||||
@ -515,7 +515,7 @@ file_list *create_freqlist(fa_list *al)
|
|||||||
for (tmpa = al; tmpa; tmpa = tmpa->next) {
|
for (tmpa = al; tmpa; tmpa = tmpa->next) {
|
||||||
nm = reqname(tmpa->addr);
|
nm = reqname(tmpa->addr);
|
||||||
if ((nm != NULL) && (stat(nm, &stbuf) == 0)) {
|
if ((nm != NULL) && (stat(nm, &stbuf) == 0)) {
|
||||||
sprintf(tmpreq, "%04X%04X.REQ", tmpa->addr->net, tmpa->addr->node);
|
snprintf(tmpreq, 12, "%04X%04X.REQ", tmpa->addr->net, tmpa->addr->node);
|
||||||
add_list(&st, nm, tmpreq, DSF, 0L, NULL, 1);
|
add_list(&st, nm, tmpreq, DSF, 0L, NULL, 1);
|
||||||
made_request = 1;
|
made_request = 1;
|
||||||
}
|
}
|
||||||
@ -668,10 +668,10 @@ char *transfertime(struct timeval start, struct timeval end, long bytes, int sen
|
|||||||
if (!elapsed)
|
if (!elapsed)
|
||||||
elapsed = 1L;
|
elapsed = 1L;
|
||||||
if (bytes > 1000000)
|
if (bytes > 1000000)
|
||||||
sprintf(resp, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
snprintf(resp, 80, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
||||||
bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes / elapsed) * 1000) / 1024);
|
bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes / elapsed) * 1000) / 1024);
|
||||||
else
|
else
|
||||||
sprintf(resp, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
snprintf(resp, 80, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)",
|
||||||
bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes * 1000) / elapsed) / 1024);
|
bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes * 1000) / elapsed) / 1024);
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
@ -682,7 +682,7 @@ char *compress_stat(long original, long saved)
|
|||||||
{
|
{
|
||||||
static char resp[81];
|
static char resp[81];
|
||||||
|
|
||||||
sprintf(resp, "compressed %ld bytes, compression %0.1f%%", saved, ((saved * 100.0) / original));
|
snprintf(resp, 80, "compressed %ld bytes, compression %0.1f%%", saved, ((saved * 100.0) / original));
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -368,7 +368,7 @@ SM_START(recv_packet)
|
|||||||
|
|
||||||
SM_STATE(recv_packet)
|
SM_STATE(recv_packet)
|
||||||
|
|
||||||
sprintf(recvpktname,"%08lx.pkt",(unsigned long)sequencer());
|
snprintf(recvpktname,15, "%08lx.pkt",(unsigned long)sequencer());
|
||||||
if ((rc = xmrecv(recvpktname)) == 1) {
|
if ((rc = xmrecv(recvpktname)) == 1) {
|
||||||
SM_SUCCESS;
|
SM_SUCCESS;
|
||||||
} else if (rc == 0) {
|
} else if (rc == 0) {
|
||||||
@ -443,7 +443,7 @@ SM_STATE(scan_packet)
|
|||||||
history.aka.node = remote->addr->node;
|
history.aka.node = remote->addr->node;
|
||||||
history.aka.point = remote->addr->point;
|
history.aka.point = remote->addr->point;
|
||||||
if (remote->addr->domain && strlen(remote->addr->domain))
|
if (remote->addr->domain && strlen(remote->addr->domain))
|
||||||
sprintf(history.aka.domain, "%s", printable(remote->addr->domain, 0));
|
snprintf(history.aka.domain, 12, "%s", printable(remote->addr->domain, 0));
|
||||||
|
|
||||||
if (((nlent=getnlent(remote->addr))) && (nlent->pflag != NL_DUMMY)) {
|
if (((nlent=getnlent(remote->addr))) && (nlent->pflag != NL_DUMMY)) {
|
||||||
Syslog('+', "remote is a listed system");
|
Syslog('+', "remote is a listed system");
|
||||||
@ -452,8 +452,8 @@ SM_STATE(scan_packet)
|
|||||||
strncpy(history.sysop, nlent->sysop, 35);
|
strncpy(history.sysop, nlent->sysop, 35);
|
||||||
UserCity(mypid, nlent->sysop, nlent->location);
|
UserCity(mypid, nlent->sysop, nlent->location);
|
||||||
} else {
|
} else {
|
||||||
sprintf(history.system_name, "Unknown");
|
snprintf(history.system_name, 35, "Unknown");
|
||||||
sprintf(history.location, "Somewhere");
|
snprintf(history.location, 35, "Somewhere");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nlent)
|
if (nlent)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Remark ................: See below for more copyright details and credits.
|
* Remark ................: See below for more copyright details and credits.
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -765,7 +765,7 @@ int hydra_batch(int role, file_list *to_send)
|
|||||||
outbuf = txbuf;
|
outbuf = txbuf;
|
||||||
|
|
||||||
/* Application ID string */
|
/* Application ID string */
|
||||||
outbuf += sprintf(outbuf, "%08lx%s,%s", H_REVSTAMP, "mbcico", VERSION) + 1;
|
outbuf += snprintf(outbuf, H_ZIPBUFLEN -1, "%08lx%s,%s", H_REVSTAMP, "mbcico", VERSION) + 1;
|
||||||
|
|
||||||
/* Supported options */
|
/* Supported options */
|
||||||
outbuf += put_flags(outbuf, HCAN_OPTIONS) + 1;
|
outbuf += put_flags(outbuf, HCAN_OPTIONS) + 1;
|
||||||
@ -776,7 +776,7 @@ int hydra_batch(int role, file_list *to_send)
|
|||||||
Syslog('h', "Hydra: desired options : %08lx", HDEF_OPTIONS & HCAN_OPTIONS & ~HUNN_OPTIONS);
|
Syslog('h', "Hydra: desired options : %08lx", HDEF_OPTIONS & HCAN_OPTIONS & ~HUNN_OPTIONS);
|
||||||
|
|
||||||
/* Desired transmitter and receiver window size */
|
/* Desired transmitter and receiver window size */
|
||||||
outbuf += sprintf(outbuf, "%08lx%08lx", H_TXWINDOW, H_RXWINDOW) + 1;
|
outbuf += snprintf(outbuf, H_ZIPBUFLEN -1, "%08lx%08lx", H_TXWINDOW, H_RXWINDOW) + 1;
|
||||||
|
|
||||||
/* Packet prefix string */
|
/* Packet prefix string */
|
||||||
*outbuf++ = 0;
|
*outbuf++ = 0;
|
||||||
@ -901,7 +901,7 @@ int hydra_batch(int role, file_list *to_send)
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (to_send) {
|
if (to_send) {
|
||||||
txlen = sprintf(txbuf, "%08lx%08lx%08lx%08lx%08lx",
|
txlen = snprintf(txbuf, H_ZIPBUFLEN -1, "%08lx%08lx%08lx%08lx%08lx",
|
||||||
(long)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)),
|
(long)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)),
|
||||||
(long)(txstat.st_size), 0UL, 0UL, 0UL);
|
(long)(txstat.st_size), 0UL, 0UL, 0UL);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer, inbound functions
|
* Purpose ...............: Fidonet mailer, inbound functions
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -62,9 +62,9 @@ int inbound_open(faddr *addr, int protected)
|
|||||||
inbound = xstrcpy(CFG.inbound);
|
inbound = xstrcpy(CFG.inbound);
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/tmp.%d.%d.%d.%d", inbound, addr->zone, addr->net, addr->node, addr->point);
|
snprintf(temp, PATH_MAX -1, "%s/tmp.%d.%d.%d.%d", inbound, addr->zone, addr->net, addr->node, addr->point);
|
||||||
tempinbound = xstrcpy(temp);
|
tempinbound = xstrcpy(temp);
|
||||||
sprintf(temp, "%s/foobar", tempinbound);
|
snprintf(temp, PATH_MAX -1, "%s/foobar", tempinbound);
|
||||||
mkdirs(temp, 0700);
|
mkdirs(temp, 0700);
|
||||||
free(temp);
|
free(temp);
|
||||||
|
|
||||||
@ -109,8 +109,8 @@ int inbound_close(int success)
|
|||||||
dest = calloc(PATH_MAX, sizeof(char));
|
dest = calloc(PATH_MAX, sizeof(char));
|
||||||
|
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
sprintf(source, "%s/%s", tempinbound, de->d_name);
|
snprintf(source, PATH_MAX -1, "%s/%s", tempinbound, de->d_name);
|
||||||
sprintf(dest, "%s/%s", inbound, de->d_name);
|
snprintf(dest, PATH_MAX -1, "%s/%s", inbound, de->d_name);
|
||||||
if ((lstat(source, &stb) == 0) && (S_ISREG(stb.st_mode))) {
|
if ((lstat(source, &stb) == 0) && (S_ISREG(stb.st_mode))) {
|
||||||
if (file_exist(dest, F_OK) == 0) {
|
if (file_exist(dest, F_OK) == 0) {
|
||||||
Syslog('!', "Cannot move %s to %s, file exists", de->d_name, inbound);
|
Syslog('!', "Cannot move %s to %s, file exists", de->d_name, inbound);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -66,9 +66,7 @@ char *date(time_t t)
|
|||||||
else
|
else
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
ptm=*localtime(&now);
|
ptm=*localtime(&now);
|
||||||
sprintf(buf,"%s %02d %02d:%02d:%02d",
|
snprintf(buf, 19, "%s %02d %02d:%02d:%02d", mon[ptm.tm_mon],ptm.tm_mday,ptm.tm_hour,ptm.tm_min,ptm.tm_sec);
|
||||||
mon[ptm.tm_mon],ptm.tm_mday,
|
|
||||||
ptm.tm_hour,ptm.tm_min,ptm.tm_sec);
|
|
||||||
return(buf);
|
return(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,9 +76,9 @@ int IsZMH()
|
|||||||
{
|
{
|
||||||
static char buf[81];
|
static char buf[81];
|
||||||
|
|
||||||
sprintf(buf, "SBBS:0;");
|
snprintf(buf, 80, "SBBS:0;");
|
||||||
if (socket_send(buf) == 0) {
|
if (socket_send(buf) == 0) {
|
||||||
strcpy(buf, socket_receive());
|
strncpy(buf, socket_receive(), 80);
|
||||||
if (strncmp(buf, "100:2,2", 7) == 0)
|
if (strncmp(buf, "100:2,2", 7) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose: Fidonet mailer
|
* Purpose: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
|||||||
* Check if history file exists, if not create a new one.
|
* Check if history file exists, if not create a new one.
|
||||||
*/
|
*/
|
||||||
cmd = calloc(PATH_MAX, sizeof(char));
|
cmd = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(cmd, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
snprintf(cmd, PATH_MAX -1, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
||||||
if ((fp = fopen(cmd, "r")) == NULL) {
|
if ((fp = fopen(cmd, "r")) == NULL) {
|
||||||
if ((fp = fopen(cmd, "a")) == NULL) {
|
if ((fp = fopen(cmd, "a")) == NULL) {
|
||||||
WriteError("$Can't create %s", cmd);
|
WriteError("$Can't create %s", cmd);
|
||||||
@ -286,7 +286,7 @@ int main(int argc, char *argv[])
|
|||||||
if (strncasecmp(p, "EMSI_NAKEEC3", 12) == 0) {
|
if (strncasecmp(p, "EMSI_NAKEEC3", 12) == 0) {
|
||||||
|
|
||||||
Syslog('+', "Detected IEMSI client, starting mblogin");
|
Syslog('+', "Detected IEMSI client, starting mblogin");
|
||||||
sprintf(temp, "%s/bin/mblogin", getenv("MBSE_ROOT"));
|
snprintf(temp, PATH_MAX -1, "%s/bin/mblogin", getenv("MBSE_ROOT"));
|
||||||
socket_shutdown(mypid);
|
socket_shutdown(mypid);
|
||||||
|
|
||||||
if (execl(temp, "mblogin", (char *)NULL) == -1)
|
if (execl(temp, "mblogin", (char *)NULL) == -1)
|
||||||
|
@ -330,7 +330,7 @@ int main(int argc, char *argv[])
|
|||||||
Fatal((char *)"File doesn't exist", MBERR_COMMANDLINE);
|
Fatal((char *)"File doesn't exist", MBERR_COMMANDLINE);
|
||||||
|
|
||||||
cmd = calloc(PATH_MAX, sizeof(char));
|
cmd = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(cmd, "%s/%d.%d.%d.%d/.filelist", CFG.out_queue, addr->zone, addr->net, addr->node, addr->point);
|
snprintf(cmd, PATH_MAX -1, "%s/%d.%d.%d.%d/.filelist", CFG.out_queue, addr->zone, addr->net, addr->node, addr->point);
|
||||||
mkdirs(cmd, 0750);
|
mkdirs(cmd, 0750);
|
||||||
if ((fl = fopen(cmd, "a+")) == NULL) {
|
if ((fl = fopen(cmd, "a+")) == NULL) {
|
||||||
Fatal((char *)"File attach failed", MBERR_ATTACH_FAILED);
|
Fatal((char *)"File attach failed", MBERR_ATTACH_FAILED);
|
||||||
|
@ -67,19 +67,19 @@ int nlinfo(faddr *addr)
|
|||||||
*/
|
*/
|
||||||
for (tmpf = &nl_online; *tmpf; tmpf = &((*tmpf)->next))
|
for (tmpf = &nl_online; *tmpf; tmpf = &((*tmpf)->next))
|
||||||
if ((nlent->oflags & (*tmpf)->value) == (*tmpf)->value)
|
if ((nlent->oflags & (*tmpf)->value) == (*tmpf)->value)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpf)->name);
|
snprintf(flagbuf + strlen(flagbuf), 255 - strlen(flagbuf), "%s,", (*tmpf)->name);
|
||||||
for (tmpf = &nl_request; *tmpf; tmpf = &((*tmpf)->next))
|
for (tmpf = &nl_request; *tmpf; tmpf = &((*tmpf)->next))
|
||||||
if (nlent->xflags == (*tmpf)->value)
|
if (nlent->xflags == (*tmpf)->value)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpf)->name);
|
snprintf(flagbuf + strlen(flagbuf), 255 - strlen(flagbuf), "%s,", (*tmpf)->name);
|
||||||
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
|
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if ((nlent->mflags & (*tmpm)->mask) == (*tmpm)->mask)
|
if ((nlent->mflags & (*tmpm)->mask) == (*tmpm)->mask)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
|
snprintf(flagbuf + strlen(flagbuf), 255 - strlen(flagbuf), "%s,", (*tmpm)->name);
|
||||||
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
|
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if ((nlent->dflags & (*tmpm)->mask) == (*tmpm)->mask)
|
if ((nlent->dflags & (*tmpm)->mask) == (*tmpm)->mask)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
|
snprintf(flagbuf + strlen(flagbuf), 255 - strlen(flagbuf), "%s,", (*tmpm)->name);
|
||||||
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next))
|
||||||
if ((nlent->iflags & (*tmpm)->mask) == (*tmpm)->mask)
|
if ((nlent->iflags & (*tmpm)->mask) == (*tmpm)->mask)
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", (*tmpm)->name);
|
snprintf(flagbuf + strlen(flagbuf), 255 - strlen(flagbuf), "%s,", (*tmpm)->name);
|
||||||
flagbuf[strlen(flagbuf)-1] = '\0';
|
flagbuf[strlen(flagbuf)-1] = '\0';
|
||||||
printf("Flags : %s\n", flagbuf);
|
printf("Flags : %s\n", flagbuf);
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ int nlinfo(faddr *addr)
|
|||||||
*/
|
*/
|
||||||
flagbuf[0] = 0;
|
flagbuf[0] = 0;
|
||||||
for (i = 0; nlent->uflags[i]; i++) {
|
for (i = 0; nlent->uflags[i]; i++) {
|
||||||
sprintf(flagbuf + strlen(flagbuf), "%s,", nlent->uflags[i]);
|
snprintf(flagbuf + strlen(flagbuf), 255 - strlen(flagbuf), "%s,", nlent->uflags[i]);
|
||||||
}
|
}
|
||||||
if (strlen(flagbuf)) {
|
if (strlen(flagbuf)) {
|
||||||
flagbuf[strlen(flagbuf) - 1] = 0;
|
flagbuf[strlen(flagbuf) - 1] = 0;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -64,7 +64,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
|
|||||||
Syslog('s', "openfile(\"%s\",%s,%lu,...)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned long)remsize);
|
Syslog('s', "openfile(\"%s\",%s,%lu,...)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned long)remsize);
|
||||||
|
|
||||||
if ((fname == NULL) || (fname[0] == '\0')) {
|
if ((fname == NULL) || (fname[0] == '\0')) {
|
||||||
sprintf(tmpfname,"%08lx.pkt",(unsigned long)sequencer());
|
snprintf(tmpfname,15,"%08lx.pkt",(unsigned long)sequencer());
|
||||||
fname=tmpfname;
|
fname=tmpfname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
|
|||||||
rc = 1;
|
rc = 1;
|
||||||
p = strrchr(infpath,'/');
|
p = strrchr(infpath,'/');
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
sprintf(ctt,"%08lx.doe",(unsigned long)sequencer());
|
snprintf(ctt,31,"%08lx.doe",(unsigned long)sequencer());
|
||||||
free(infpath);
|
free(infpath);
|
||||||
infpath = xstrcpy(p);
|
infpath = xstrcpy(p);
|
||||||
infpath = xstrcat(infpath, ctt);
|
infpath = xstrcat(infpath, ctt);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -195,7 +195,7 @@ void closetcp(void)
|
|||||||
history.rcvd_bytes = rcvdbytes;
|
history.rcvd_bytes = rcvdbytes;
|
||||||
history.inbound = ~master;
|
history.inbound = ~master;
|
||||||
tmp = calloc(PATH_MAX, sizeof(char));
|
tmp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(tmp, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
snprintf(tmp, PATH_MAX -1, "%s/var/mailer.hist", getenv("MBSE_ROOT"));
|
||||||
if ((fph = fopen(tmp, "a")) == NULL)
|
if ((fph = fopen(tmp, "a")) == NULL)
|
||||||
WriteError("$Can't open %s", tmp);
|
WriteError("$Can't open %s", tmp);
|
||||||
else {
|
else {
|
||||||
|
@ -79,7 +79,7 @@ void checkdir(char *boxpath, faddr *fa, char flavor)
|
|||||||
} else {
|
} else {
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
||||||
sprintf(temp, "%s/%s", boxpath, de->d_name);
|
snprintf(temp, PATH_MAX -1, "%s/%s", boxpath, de->d_name);
|
||||||
if (stat(temp, &sb) == 0) {
|
if (stat(temp, &sb) == 0) {
|
||||||
Syslog('o' ,"checking: \"%s\"", de->d_name);
|
Syslog('o' ,"checking: \"%s\"", de->d_name);
|
||||||
if (S_ISREG(sb.st_mode)) {
|
if (S_ISREG(sb.st_mode)) {
|
||||||
@ -149,7 +149,7 @@ int outstat()
|
|||||||
* Also, check directory outbounds for FTP nodes.
|
* Also, check directory outbounds for FTP nodes.
|
||||||
*/
|
*/
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/etc/nodes.data", getenv("MBSE_ROOT"));
|
snprintf(temp, PATH_MAX -1, "%s/etc/nodes.data", getenv("MBSE_ROOT"));
|
||||||
if ((fp = fopen(temp, "r")) == NULL) {
|
if ((fp = fopen(temp, "r")) == NULL) {
|
||||||
WriteError("$Error open %s, aborting", temp);
|
WriteError("$Error open %s, aborting", temp);
|
||||||
free(temp);
|
free(temp);
|
||||||
@ -188,7 +188,7 @@ int outstat()
|
|||||||
Syslog('o', "Checking T-Mail short box \"%s\"", CFG.tmailshort);
|
Syslog('o', "Checking T-Mail short box \"%s\"", CFG.tmailshort);
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
||||||
sprintf(temp, "%s/%s", CFG.tmailshort, de->d_name);
|
snprintf(temp, PATH_MAX -1, "%s/%s", CFG.tmailshort, de->d_name);
|
||||||
if (stat(temp, &sb) == 0) {
|
if (stat(temp, &sb) == 0) {
|
||||||
Syslog('o' ,"checking \"%s\"", de->d_name);
|
Syslog('o' ,"checking \"%s\"", de->d_name);
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
if (S_ISDIR(sb.st_mode)) {
|
||||||
@ -251,13 +251,13 @@ int outstat()
|
|||||||
Syslog('o', "Checking T-Mail long box \"%s\"", CFG.tmaillong);
|
Syslog('o', "Checking T-Mail long box \"%s\"", CFG.tmaillong);
|
||||||
while ((de = readdir(dp))) {
|
while ((de = readdir(dp))) {
|
||||||
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) {
|
||||||
sprintf(temp, "%s/%s", CFG.tmaillong, de->d_name);
|
snprintf(temp, PATH_MAX -1, "%s/%s", CFG.tmaillong, de->d_name);
|
||||||
if (stat(temp, &sb) == 0) {
|
if (stat(temp, &sb) == 0) {
|
||||||
Syslog('o' ,"checking \"%s\"", de->d_name);
|
Syslog('o' ,"checking \"%s\"", de->d_name);
|
||||||
if (S_ISDIR(sb.st_mode)) {
|
if (S_ISDIR(sb.st_mode)) {
|
||||||
char c, d;
|
char c, d;
|
||||||
int n;
|
int n;
|
||||||
sprintf(temp2, "%s", de->d_name);
|
snprintf(temp2, PATH_MAX -1, "%s", de->d_name);
|
||||||
fa = (faddr*)malloc(sizeof(faddr));
|
fa = (faddr*)malloc(sizeof(faddr));
|
||||||
fa->name = NULL;
|
fa->name = NULL;
|
||||||
fa->domain = NULL;
|
fa->domain = NULL;
|
||||||
@ -301,7 +301,8 @@ int outstat()
|
|||||||
cst = getstatus(&(tmp->addr));
|
cst = getstatus(&(tmp->addr));
|
||||||
age = time(NULL);
|
age = time(NULL);
|
||||||
age -= tmp->time;
|
age -= tmp->time;
|
||||||
sprintf(temp, "%s %3d %9lu %s %s", flstr, cst->tryno, (long)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f));
|
snprintf(temp, PATH_MAX -1, "%s %3d %9lu %s %s",
|
||||||
|
flstr, cst->tryno, (long)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f));
|
||||||
|
|
||||||
if (!do_quiet)
|
if (!do_quiet)
|
||||||
printf("%s\n", temp);
|
printf("%s\n", temp);
|
||||||
@ -442,9 +443,9 @@ int IsZMH()
|
|||||||
{
|
{
|
||||||
static char buf[81];
|
static char buf[81];
|
||||||
|
|
||||||
sprintf(buf, "SBBS:0;");
|
snprintf(buf, 80, "SBBS:0;");
|
||||||
if (socket_send(buf) == 0) {
|
if (socket_send(buf) == 0) {
|
||||||
strcpy(buf, socket_receive());
|
strncpy(buf, socket_receive(), 80);
|
||||||
if (strncmp(buf, "100:2,2", 7) == 0)
|
if (strncmp(buf, "100:2,2", 7) == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -42,7 +42,7 @@ int load_port(char *tty)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
snprintf(temp, PATH_MAX -1, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
||||||
|
|
||||||
if ((fp = fopen(temp, "r")) == NULL) {
|
if ((fp = fopen(temp, "r")) == NULL) {
|
||||||
WriteError("$Can't open %s", temp);
|
WriteError("$Can't open %s", temp);
|
||||||
@ -93,7 +93,7 @@ int load_modem(char *ModemName)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
temp = calloc(PATH_MAX, sizeof(char));
|
temp = calloc(PATH_MAX, sizeof(char));
|
||||||
sprintf(temp, "%s/etc/modem.data", getenv("MBSE_ROOT"));
|
snprintf(temp, PATH_MAX -1, "%s/etc/modem.data", getenv("MBSE_ROOT"));
|
||||||
|
|
||||||
if ((fp = fopen(temp, "r")) == NULL) {
|
if ((fp = fopen(temp, "r")) == NULL) {
|
||||||
WriteError("$Can't open %s", temp);
|
WriteError("$Can't open %s", temp);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer - respond to filerequests
|
* Purpose ...............: Fidonet mailer - respond to filerequests
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -438,7 +438,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */
|
|||||||
|
|
||||||
Syslog('+', "Magic execute: %s", strrchr(xstrcpy(cmd), '/')+1);
|
Syslog('+', "Magic execute: %s", strrchr(xstrcpy(cmd), '/')+1);
|
||||||
add_report((char *)"RQ: Magic \"%s\"",cmd);
|
add_report((char *)"RQ: Magic \"%s\"",cmd);
|
||||||
sprintf(tmpfn, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
||||||
Syslog('+', "tmpfn \"%s\"", tmpfn);
|
Syslog('+', "tmpfn \"%s\"", tmpfn);
|
||||||
if ((p = strrchr(cmd,'/')))
|
if ((p = strrchr(cmd,'/')))
|
||||||
p++;
|
p++;
|
||||||
@ -483,7 +483,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */
|
|||||||
unlink(tmpfn);
|
unlink(tmpfn);
|
||||||
} else {
|
} else {
|
||||||
if (stat(tmpfn, &st) == 0) {
|
if (stat(tmpfn, &st) == 0) {
|
||||||
sprintf(tmptx, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
snprintf(tmptx, PATH_MAX -1, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
||||||
Syslog('+', "tmptx \"%s\"", tmptx);
|
Syslog('+', "tmptx \"%s\"", tmptx);
|
||||||
|
|
||||||
if ((fp = fopen(tmptx, "w"))) {
|
if ((fp = fopen(tmptx, "w"))) {
|
||||||
@ -523,7 +523,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */
|
|||||||
}
|
}
|
||||||
fwrite(&zeroes, 1, 3, fp);
|
fwrite(&zeroes, 1, 3, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
sprintf(remname, "%08lX.PKT", (unsigned long)sequencer());
|
snprintf(remname, 31, "%08lX.PKT", (unsigned long)sequencer());
|
||||||
|
|
||||||
add_list(&fl, tmptx, remname, KFS, 0L, NULL, 0);
|
add_list(&fl, tmptx, remname, KFS, 0L, NULL, 0);
|
||||||
fmsg.from->name = svname;
|
fmsg.from->name = svname;
|
||||||
@ -574,7 +574,7 @@ static void attach_report(file_list **fl)
|
|||||||
/*
|
/*
|
||||||
* Add random quote
|
* Add random quote
|
||||||
*/
|
*/
|
||||||
sprintf(tmpfn, "%s/etc/oneline.data", getenv("MBSE_ROOT"));
|
snprintf(tmpfn, PATH_MAX -1, "%s/etc/oneline.data", getenv("MBSE_ROOT"));
|
||||||
if ((fp = fopen(tmpfn, "r+")) != NULL) {
|
if ((fp = fopen(tmpfn, "r+")) != NULL) {
|
||||||
fread(&olhdr, sizeof(olhdr), 1, fp);
|
fread(&olhdr, sizeof(olhdr), 1, fp);
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
@ -595,7 +595,7 @@ static void attach_report(file_list **fl)
|
|||||||
|
|
||||||
add_report((char *)"\r%s\r", TearLine());
|
add_report((char *)"\r%s\r", TearLine());
|
||||||
|
|
||||||
sprintf(tmpfn, "%s/tmp/%08lX.rpl", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08lX.rpl", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer());
|
||||||
if ((fp = fopen(tmpfn,"w"))) {
|
if ((fp = fopen(tmpfn,"w"))) {
|
||||||
fmsg.flags = M_PVT|M_KILLSENT;
|
fmsg.flags = M_PVT|M_KILLSENT;
|
||||||
fmsg.from = bestaka_s(remote->addr);
|
fmsg.from = bestaka_s(remote->addr);
|
||||||
@ -622,7 +622,7 @@ static void attach_report(file_list **fl)
|
|||||||
fwrite(report_text, 1, strlen(report_text), fp);
|
fwrite(report_text, 1, strlen(report_text), fp);
|
||||||
fwrite(&zeroes, 1, 3, fp);
|
fwrite(&zeroes, 1, 3, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
sprintf(remname, "%08lX.PKT", (unsigned long)sequencer());
|
snprintf(remname, 13, "%08lX.PKT", (unsigned long)sequencer());
|
||||||
add_list(fl, tmpfn, remname, KFS, 0L, NULL, 0);
|
add_list(fl, tmpfn, remname, KFS, 0L, NULL, 0);
|
||||||
fmsg.from->name = svname;
|
fmsg.from->name = svname;
|
||||||
} else {
|
} else {
|
||||||
@ -643,13 +643,13 @@ static void add_report(char *format, ...)
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
if (report_text == NULL) {
|
if (report_text == NULL) {
|
||||||
sprintf(buf,
|
snprintf(buf, 1023,
|
||||||
" Status of file request\r\
|
" Status of file request\r\
|
||||||
======================\r\r\
|
======================\r\r\
|
||||||
Received By: %s\r\
|
Received By: %s\r\
|
||||||
",
|
",
|
||||||
ascfnode(bestaka_s(remote->addr),0x1f));
|
ascfnode(bestaka_s(remote->addr),0x1f));
|
||||||
sprintf(buf+strlen(buf),
|
snprintf(buf+strlen(buf), 1023 - strlen(buf),
|
||||||
" From: %s\r\
|
" From: %s\r\
|
||||||
On: %s\r\r\
|
On: %s\r\r\
|
||||||
",
|
",
|
||||||
@ -659,7 +659,7 @@ static void add_report(char *format, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
va_start(va_ptr, format);
|
va_start(va_ptr, format);
|
||||||
vsprintf(buf, format, va_ptr);
|
vsnprintf(buf, 1023, format, va_ptr);
|
||||||
va_end(va_ptr);
|
va_end(va_ptr);
|
||||||
strcat(buf,"\r");
|
strcat(buf,"\r");
|
||||||
report_text = xstrcat(report_text,buf);
|
report_text = xstrcat(report_text,buf);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -63,7 +63,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
|
|||||||
/*
|
/*
|
||||||
* Create a fake filename, mkdirs() likes that.
|
* Create a fake filename, mkdirs() likes that.
|
||||||
*/
|
*/
|
||||||
sprintf(fname, "%s/foo", dname);
|
snprintf(fname, PATH_MAX -1, "%s/foo", dname);
|
||||||
(void)mkdirs(fname, 0770);
|
(void)mkdirs(fname, 0770);
|
||||||
if ((dp = opendir(dname)) == NULL) {
|
if ((dp = opendir(dname)) == NULL) {
|
||||||
Syslog('o' ,"\"%s\" cannot be opened, proceed",MBSE_SS(dname));
|
Syslog('o' ,"\"%s\" cannot be opened, proceed",MBSE_SS(dname));
|
||||||
@ -135,7 +135,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo
|
|||||||
goto exout;
|
goto exout;
|
||||||
|
|
||||||
Syslog('o' ,"arcmail file \"%s\"",de->d_name);
|
Syslog('o' ,"arcmail file \"%s\"",de->d_name);
|
||||||
sprintf(fname, "%s/%s", dname, de->d_name);
|
snprintf(fname, PATH_MAX -1, "%s/%s", dname, de->d_name);
|
||||||
fage = (int)((t_start - file_time(fname)) / 86400);
|
fage = (int)((t_start - file_time(fname)) / 86400);
|
||||||
|
|
||||||
if (file_size(fname) == 0) {
|
if (file_size(fname) == 0) {
|
||||||
@ -210,7 +210,7 @@ int scanout(int (*fn)(faddr *, char, int, char *))
|
|||||||
*/
|
*/
|
||||||
if (fidonet.zone[j]) {
|
if (fidonet.zone[j]) {
|
||||||
if (j) {
|
if (j) {
|
||||||
sprintf(fext, ".%03x", fidonet.zone[j]);
|
snprintf(fext, 4, ".%03x", fidonet.zone[j]);
|
||||||
p = xstrcat(p, fext);
|
p = xstrcat(p, fext);
|
||||||
}
|
}
|
||||||
Syslog('o', "Zone %d Dir %s", fidonet.zone[j], p);
|
Syslog('o', "Zone %d Dir %s", fidonet.zone[j], p);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -123,7 +123,7 @@ SM_EDECL
|
|||||||
unsigned short crc;
|
unsigned short crc;
|
||||||
int c, count = 0;
|
int c, count = 0;
|
||||||
|
|
||||||
sprintf(buf,"%s %s %s",nm,dt,pw);
|
snprintf(buf,255,"%s %s %s",nm,dt,pw);
|
||||||
crc = crc16xmodem(buf, strlen(buf));
|
crc = crc16xmodem(buf, strlen(buf));
|
||||||
Syslog('s', "sending bark packet \"%s\", crc = 0x%04x", buf, crc);
|
Syslog('s', "sending bark packet \"%s\", crc = 0x%04x", buf, crc);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -222,7 +222,7 @@ static int sendtfile(char *ln, char *rn)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(txbuf,"S %s %lu %lu",rn,(unsigned long)st.st_size,(unsigned long)st.st_mtime+(st.st_mtime%2));
|
snprintf(txbuf,TCP_BLKSIZE -1, "S %s %lu %lu",rn,(unsigned long)st.st_size,(unsigned long)st.st_mtime+(st.st_mtime%2));
|
||||||
bufl = strlen(txbuf);
|
bufl = strlen(txbuf);
|
||||||
rc = tcp_sblk(txbuf, bufl, TCP_CMD);
|
rc = tcp_sblk(txbuf, bufl, TCP_CMD);
|
||||||
rc = tcp_rblk(rxbuf, &bufl);
|
rc = tcp_rblk(rxbuf, &bufl);
|
||||||
@ -274,7 +274,7 @@ static int sendtfile(char *ln, char *rn)
|
|||||||
|
|
||||||
static int resync(off_t off)
|
static int resync(off_t off)
|
||||||
{
|
{
|
||||||
sprintf(txbuf,"ROK %ld",(long)off);
|
snprintf(txbuf, TCP_BLKSIZE -1, "ROK %ld",(long)off);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -59,7 +59,7 @@ int lock(char *line)
|
|||||||
else
|
else
|
||||||
p++;
|
p++;
|
||||||
mypid = getpid();
|
mypid = getpid();
|
||||||
sprintf(tmpname,"%s%d",LCKTMP,mypid);
|
snprintf(tmpname,255,"%s%d",LCKTMP,mypid);
|
||||||
if ((f = fopen(tmpname,"w")) == NULL) {
|
if ((f = fopen(tmpname,"w")) == NULL) {
|
||||||
WriteError("$ulock: can't create %s",tmpname);
|
WriteError("$ulock: can't create %s",tmpname);
|
||||||
return(-1);
|
return(-1);
|
||||||
@ -68,7 +68,7 @@ int lock(char *line)
|
|||||||
fprintf(f,"%10d\n",mypid);
|
fprintf(f,"%10d\n",mypid);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
chmod(tmpname,0444);
|
chmod(tmpname,0444);
|
||||||
sprintf(lckname,"%s%s",LCKPREFIX,p);
|
snprintf(lckname,255,"%s%s",LCKPREFIX,p);
|
||||||
p=lckname+strlen(lckname)-1;
|
p=lckname+strlen(lckname)-1;
|
||||||
*p=tolower(*p);
|
*p=tolower(*p);
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ int ulock(char *line)
|
|||||||
else
|
else
|
||||||
p++;
|
p++;
|
||||||
mypid=getpid();
|
mypid=getpid();
|
||||||
sprintf(lckname,"%s%s",LCKPREFIX,p);
|
snprintf(lckname,255,"%s%s",LCKPREFIX,p);
|
||||||
p=lckname+strlen(lckname)-1;
|
p=lckname+strlen(lckname)-1;
|
||||||
*p=tolower(*p);
|
*p=tolower(*p);
|
||||||
|
|
||||||
|
@ -555,7 +555,7 @@ int resync(off_t resofs)
|
|||||||
Syslog('x', "trying to resync at offset %ld",resofs);
|
Syslog('x', "trying to resync at offset %ld",resofs);
|
||||||
|
|
||||||
sblk=resofs/XMBLKSIZ+1;
|
sblk=resofs/XMBLKSIZ+1;
|
||||||
sprintf(resynbuf,"%ld",sblk);
|
snprintf(resynbuf,15,"%ld",sblk);
|
||||||
lcrc=crc16xmodem(resynbuf,strlen(resynbuf));
|
lcrc=crc16xmodem(resynbuf,strlen(resynbuf));
|
||||||
gotack=0;
|
gotack=0;
|
||||||
gotnak=0;
|
gotnak=0;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -206,7 +206,7 @@ SM_STATE(sendblk0)
|
|||||||
if (telink)
|
if (telink)
|
||||||
for (i=23;(i>8) && (xmblk.data[i] == '\0');i--)
|
for (i=23;(i>8) && (xmblk.data[i] == '\0');i--)
|
||||||
xmblk.data[i]=' ';
|
xmblk.data[i]=' ';
|
||||||
sprintf(xmblk.data+25,"mbcico %s",VERSION);
|
snprintf(xmblk.data+25, 15, "mbcico %s", VERSION);
|
||||||
xmblk.data[40]=((session_flags & FTSC_XMODEM_SLO) != 0);
|
xmblk.data[40]=((session_flags & FTSC_XMODEM_SLO) != 0);
|
||||||
xmblk.data[41]=((session_flags & FTSC_XMODEM_RES) != 0);
|
xmblk.data[41]=((session_flags & FTSC_XMODEM_RES) != 0);
|
||||||
xmblk.data[42]=((session_flags & FTSC_XMODEM_XOF) != 0);
|
xmblk.data[42]=((session_flags & FTSC_XMODEM_XOF) != 0);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -604,7 +604,7 @@ int checkhello(void)
|
|||||||
strncpy(history.system_name, hello2.my_name, 35);
|
strncpy(history.system_name, hello2.my_name, 35);
|
||||||
Syslog('+', " sysop: %s",(char*)hello2.sysop);
|
Syslog('+', " sysop: %s",(char*)hello2.sysop);
|
||||||
strncpy(history.sysop, hello2.sysop, 35);
|
strncpy(history.sysop, hello2.sysop, 35);
|
||||||
sprintf(history.location, "Somewhere");
|
snprintf(history.location, 10, "Somewhere");
|
||||||
|
|
||||||
free(prodnm);
|
free(prodnm);
|
||||||
return loaded;
|
return loaded;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* Purpose ...............: Fidonet mailer
|
* Purpose ...............: Fidonet mailer
|
||||||
*
|
*
|
||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
* Copyright (C) 1997-2004
|
* Copyright (C) 1997-2005
|
||||||
*
|
*
|
||||||
* Michiel Broek FIDO: 2:280/2802
|
* Michiel Broek FIDO: 2:280/2802
|
||||||
* Beekmansbos 10
|
* Beekmansbos 10
|
||||||
@ -213,7 +213,8 @@ static int sendzfile(char *ln, char *rn)
|
|||||||
Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
|
Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime));
|
||||||
gettimeofday(&starttime, &tz);
|
gettimeofday(&starttime, &tz);
|
||||||
|
|
||||||
sprintf(txbuf,"%s %lu %lo %o 0 0 0", rn,(unsigned long)st.st_size, (long)st.st_mtime+((long)st.st_mtime%2), st.st_mode);
|
snprintf(txbuf,MAXBLOCK -1, "%s %lu %lo %o 0 0 0", rn,
|
||||||
|
(unsigned long)st.st_size, (long)st.st_mtime+((long)st.st_mtime%2), st.st_mode);
|
||||||
bufl = strlen(txbuf);
|
bufl = strlen(txbuf);
|
||||||
*(strchr(txbuf,' ')) = '\0'; /*hope no blanks in filename*/
|
*(strchr(txbuf,' ')) = '\0'; /*hope no blanks in filename*/
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ void load_maincfg(void)
|
|||||||
sprintf(CFG.sysdomain, "%s.%s", un.nodename, un.domainname);
|
sprintf(CFG.sysdomain, "%s.%s", un.nodename, un.domainname);
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
sprintf(CFG.sysdomain, "%s.%s", un.nodename, un.__domainname);
|
sprintf(CFG.sysdomain, "%s.%s", un.nodename, un.__domainname);
|
||||||
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
sprintf(CFG.sysdomain, "%s", un.nodename); /* No domain in FreeBSD */
|
sprintf(CFG.sysdomain, "%s", un.nodename); /* No domain in FreeBSD */
|
||||||
#else
|
#else
|
||||||
#error "Don't know un.domainname on this OS"
|
#error "Don't know un.domainname on this OS"
|
||||||
|
Reference in New Issue
Block a user