Skip to content
Snippets Groups Projects
Commit d9a5999d authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add -N option to disable to/from name CRC checking

Recently started truncating trailing whitespace from sender/recipient names
before calculating the CRC value (similar to what we do for message subjects
as of a year ago). To suppress errors when evaluating messages (with trailing
whitespace in sender or recipient namems) created or imported before this
change, use this new -N option.
parent 49cda4ee
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4343 passed
......@@ -133,6 +133,7 @@ char *usage="\nusage: chksmb [-opts] <filespec.SHD>\n"
" t - don't check translation strings\n"
" i - don't check message IDs\n"
" S - don't check subject CRCs\n"
" N - don't check to/from name CRCs\n"
" e - display extended info on corrupted msgs\n";
int main(int argc, char **argv)
......@@ -146,6 +147,7 @@ int main(int argc, char **argv)
,lzhmsg,extinfo=FALSE,msgerr;
BOOL chk_msgids = TRUE;
BOOL chk_subjcrc = TRUE;
BOOL chk_namecrc = TRUE;
uint16_t xlat;
uint32_t m;
ulong l,n,size,total=0,orphan,deleted,headers
......@@ -216,6 +218,9 @@ int main(int argc, char **argv)
case 'S':
chk_subjcrc = FALSE;
break;
case 'N':
chk_namecrc = FALSE;
break;
case 't':
chkxlat=FALSE;
break;
......@@ -601,7 +606,7 @@ int main(int argc, char **argv)
,msg.from_ext,msg.idx.from);
fromcrc++;
}
if(!(smb.status.attr & SMB_EMAIL)
if(chk_namecrc && !(smb.status.attr & SMB_EMAIL)
&& (msg.hdr.type == SMB_MSG_TYPE_NORMAL || msg.hdr.type == SMB_MSG_TYPE_POLL)
&& msg.idx.from!=smb_name_crc(msg.from)) {
fprintf(stderr,"%sFrom CRC mismatch\n",beep);
......@@ -623,7 +628,7 @@ int main(int argc, char **argv)
,msg.to_ext,msg.idx.to);
tocrc++;
}
if(!(smb.status.attr & SMB_EMAIL)
if(chk_namecrc && !(smb.status.attr & SMB_EMAIL)
&& (msg.hdr.type == SMB_MSG_TYPE_NORMAL || msg.hdr.type == SMB_MSG_TYPE_POLL)
&& msg.to_ext==NULL && msg.idx.to!=smb_name_crc(msg.to)) {
fprintf(stderr,"%sTo CRC mismatch\n",beep);
......@@ -780,7 +785,7 @@ int main(int argc, char **argv)
headers++;
if(msgerr && extinfo) {
printf("\n");
printf("%-20s %s\n","message base",smb.file);
printf("%-16s %s\n","message base",smb.file);
smb_dump_msghdr(stdout,&msg);
printf("\n");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment