Skip to content
Snippets Groups Projects
Commit d080521b authored by rswindell's avatar rswindell
Browse files

Will now repair a SMB status header's 'last_msg' value if it's lower than

the highest message number indexed.
parent c94c41fd
Branches
Tags
No related merge requests found
......@@ -108,6 +108,7 @@ int fixsmb(char* sub)
uint32_t* numbers = NULL;
uint32_t total = 0;
BOOL dupe_msgnum;
uint32_t highest = 0;
memset(&smb,0,sizeof(smb));
......@@ -247,6 +248,8 @@ int fixsmb(char* sub)
msg.offset=n;
if(renumber)
msg.hdr.number=n+1;
if(msg.hdr.number > highest)
highest = msg.hdr.number;
if(msg.hdr.netattr&MSG_INTRANSIT) {
printf("Removing 'in transit' attribute\n");
msg.hdr.netattr&=~MSG_INTRANSIT;
......@@ -282,9 +285,12 @@ int fixsmb(char* sub)
printf("\r%79s\r100%%\n","");
smb.status.total_msgs=n;
if(renumber)
smb.status.last_msg=n;
else
smb.status.last_msg = highest;
else {
if(highest > smb.status.last_msg)
smb.status.last_msg = highest;
sort_index(&smb);
}
printf("Saving message base status (%lu total messages).\n",n);
if((i=smb_putstatus(&smb))!=0)
printf("\nsmb_putstatus returned %d: %s\n",i,smb.last_error);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment