Some small changers to the tosser

This commit is contained in:
Michiel Broek 2003-02-21 20:01:25 +00:00
parent 827cbede63
commit e73a81b155
4 changed files with 37 additions and 17 deletions

View File

@ -73,6 +73,11 @@ v0.37.01 14-Jan-2003.
If echomail is accepted in a unsecure area or the unsecure If echomail is accepted in a unsecure area or the unsecure
commandline option is set, a violation is logged as warning. commandline option is set, a violation is logged as warning.
Removed some debugging tests and log messages. Removed some debugging tests and log messages.
If a tic file was received in uppercase, during import in the
bbs the LFN is converted to lowercase.
Removed a debug logmessage from file forward.
Promoted some normal debug logmessages to heavy debug messages
in the outbound queue packer.
mbdiff: mbdiff:
If unpacking a diff file fails, a second attempt is done after If unpacking a diff file fails, a second attempt is done after

View File

@ -57,7 +57,7 @@ int Add_BBS()
struct FILERecord frec; struct FILERecord frec;
int rc, i, Insert, Done = FALSE, Found = FALSE; int rc, i, Insert, Done = FALSE, Found = FALSE;
char fdbname[PATH_MAX], fdbtemp[PATH_MAX]; char fdbname[PATH_MAX], fdbtemp[PATH_MAX];
char temp1[PATH_MAX], temp2[PATH_MAX], *fname, *lname; char temp1[PATH_MAX], temp2[PATH_MAX], *fname, *lname, *p;
FILE *fdb, *fdt; FILE *fdb, *fdt;
int Keep = 0, DidDelete = FALSE; int Keep = 0, DidDelete = FALSE;
fd_list *fdl = NULL; fd_list *fdl = NULL;
@ -146,6 +146,26 @@ int Add_BBS()
return FALSE; return FALSE;
} }
chmod(temp2, 0644); chmod(temp2, 0644);
/*
* If LFN = 8.3 name and is DOS 8.3 format, change the LFN to lowercase.
*/
if (strcmp(frec.Name, frec.LName) == 0) {
p = frec.LName;
while (*p) {
if (islower(*p))
Found = TRUE;
p++;
}
if (!Found) {
/*
* All uppercase, change to lowercase.
*/
tl(frec.LName);
Syslog('f', "Converted LFN to lowercase: \"%s\"", frec.LName);
}
}
Found = FALSE;
lname = calloc(PATH_MAX, sizeof(char)); lname = calloc(PATH_MAX, sizeof(char));
sprintf(lname, "%s/%s", TIC.BBSpath, frec.LName); sprintf(lname, "%s/%s", TIC.BBSpath, frec.LName);
if (symlink(temp2, lname)) { if (symlink(temp2, lname)) {

View File

@ -60,7 +60,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
WriteError("TIC forward in %s, node %s not in setup but defined in area setup", TIC.TicIn.Area, aka2str(Node)); WriteError("TIC forward in %s, node %s not in setup but defined in area setup", TIC.TicIn.Area, aka2str(Node));
return; return;
} }
Syslog('+', "Forward file to %s, %s netmail", aka2str(Node), nodes.Message?"with":"without"); Syslog('+', "Forward file to %s %s netmail", aka2str(Node), nodes.Message?"with":"without");
/* /*
* If Costsharing active for this node * If Costsharing active for this node
@ -97,7 +97,6 @@ void ForwardFile(fidoaddr Node, fa_list *sbl)
free(queuedir); free(queuedir);
return; return;
} }
Syslog('f', "%s is open", listfile);
/* /*
* Create the full filename * Create the full filename

View File

@ -57,9 +57,9 @@ extern int flushed;
char *Basename(char *); char *Basename(char *);
char *Basename(char *str) char *Basename(char *str)
{ {
char *cp = strrchr(str, '/'); char *cp = strrchr(str, '/');
return cp ? cp+1 : str; return cp ? cp+1 : str;
} }
@ -213,7 +213,7 @@ void flush_dir(char *ndir)
} else { } else {
sprintf(arcfile, "%s", arcname(&noden, nodes.Aka[0].zone, nodes.ARCmailCompat)); sprintf(arcfile, "%s", arcname(&noden, nodes.Aka[0].zone, nodes.ARCmailCompat));
} }
Syslog('p', "Arcmail file %s", arcfile); Syslog('P', "Arcmail file %s", arcfile);
/* /*
* If there is a mailpkt.qqq file, close it and rename it. * If there is a mailpkt.qqq file, close it and rename it.
@ -236,7 +236,7 @@ void flush_dir(char *ndir)
putc('\0', fp); putc('\0', fp);
fsync(fileno(fp)); fsync(fileno(fp));
fclose(fp); fclose(fp);
Syslog('p', "Renamed %s to %s", fname, pktfile); Syslog('P', "Renamed %s to %s", fname, pktfile);
} }
} }
free(fname); free(fname);
@ -380,7 +380,7 @@ void flush_dir(char *ndir)
} }
if (first) { if (first) {
Syslog('+', "Pack ARCmail for %s, via %s", aka2str(nodenr), ascfnode(&noden, 0x1f)); Syslog('+', "Pack ARCmail for %s via %s", aka2str(nodenr), ascfnode(&noden, 0x1f));
if (!do_quiet) { if (!do_quiet) {
printf("\rAdding ARCmail for %s ", ascfnode(&noden, 0x1f)); printf("\rAdding ARCmail for %s ", ascfnode(&noden, 0x1f));
fflush(stdout); fflush(stdout);
@ -449,7 +449,7 @@ void flush_dir(char *ndir)
first = TRUE; first = TRUE;
while ((fname = pull_fdlist(&fdl)) != NULL) { while ((fname = pull_fdlist(&fdl)) != NULL) {
if (first) { if (first) {
Syslog('+', "Pack unpacked mail for %s, via %s", aka2str(nodenr), ascfnode(&noden, 0x1f)); Syslog('+', "Pack unpacked mail for %s via %s", aka2str(nodenr), ascfnode(&noden, 0x1f));
if (!do_quiet) { if (!do_quiet) {
printf("\rAdding netmail for %s ", ascfnode(&noden, 0x1f)); printf("\rAdding netmail for %s ", ascfnode(&noden, 0x1f));
fflush(stdout); fflush(stdout);
@ -470,16 +470,12 @@ void flush_dir(char *ndir)
flavor = 'o'; flavor = 'o';
if (nodes.Session_out == S_DIR) { if (nodes.Session_out == S_DIR) {
// if (noden.point)
// sprintf(arcfile, "%s/%08x.%cut", nodes.Dir_out_path, noden.point, flavor);
// else
// sprintf(arcfile, "%s/%04x%04x.%cut", nodes.Dir_out_path, noden.net, noden.node, flavor);
sprintf(arcfile, "%s/%08lx.pkt", nodes.Dir_out_path, sequencer()); sprintf(arcfile, "%s/%08lx.pkt", nodes.Dir_out_path, sequencer());
} else { } else {
sprintf(arcfile, "%s", pktname(&noden, flavor)); sprintf(arcfile, "%s", pktname(&noden, flavor));
} }
Syslog('p', "Outfile: %s", arcfile); Syslog('P', "Outfile: %s", arcfile);
Syslog('p', "Pktfile: %s", pktfile); Syslog('P', "Pktfile: %s", pktfile);
/* /*
* Now we must see if there is already mail in the outbound. * Now we must see if there is already mail in the outbound.
@ -534,7 +530,7 @@ void flush_dir(char *ndir)
sprintf(pktfile, "%s/.filelist", temp); sprintf(pktfile, "%s/.filelist", temp);
if ((fp = fopen(pktfile, "r")) != NULL) { if ((fp = fopen(pktfile, "r")) != NULL) {
Syslog('+', "Adding files for %s, via %s", aka2str(nodenr), ascfnode(&noden, 0x1f)); Syslog('+', "Adding files for %s via %s", aka2str(nodenr), ascfnode(&noden, 0x1f));
if (!do_quiet) { if (!do_quiet) {
printf("\rAdding files for %s ", ascfnode(&noden, 0x1f)); printf("\rAdding files for %s ", ascfnode(&noden, 0x1f));
fflush(stdout); fflush(stdout);
@ -582,7 +578,7 @@ void flush_dir(char *ndir)
chmod(arcfile, 0660); chmod(arcfile, 0660);
} }
Syslog('p', "%c %d %s", flavor, mode, pktfile); Syslog('P', "%c %d %s", flavor, mode, pktfile);
} }