Page MenuHomeFreeBSD

dma: restore addition of newline when missing from input
ClosedPublic

Authored by emaste on Sep 27 2022, 7:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 26, 5:58 AM
Unknown Object (File)
May 14 2024, 5:14 PM
Unknown Object (File)
Apr 26 2024, 9:48 PM
Unknown Object (File)
Apr 26 2024, 9:47 PM
Unknown Object (File)
Apr 26 2024, 9:46 PM
Unknown Object (File)
Apr 26 2024, 9:46 PM
Unknown Object (File)
Apr 26 2024, 6:06 PM
Unknown Object (File)
Mar 10 2024, 8:43 PM

Details

Summary

If input mail does not have a newline on the last line dma must add one. This was broken by the addition of long-line splitting, with the switch from strlen(line) to linelen returned by getline().

PR: 266629
MFC after: 1 week
Fixes: b0b2d05fd060 ("Split body of mails not respecting...")
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

I don't really like this, but also want to avoid any larger rework independent of upstream. This could be cleaned up as part of a project to upstream long-line splitting.

mslehto_kapsi.fi added a subscriber: mslehto_kapsi.fi.

Looks good to me, just small inline comment or question regarding linecap.

contrib/dma/mail.c
423

Does it matter here when "linecap" is not updated after succesful realloc()?

If not, simplicity is definitely good in exchange for upstream compatibility!

This revision now requires changes to proceed.Sep 28 2022, 4:21 PM
contrib/dma/mail.c
423

Yes, I think it would have no functional issue to leave it, but should be updated.

Revision D36763 / 111185 works for me: code compiles and does not produce "corrupted queue files" error.

This revision is now accepted and ready to land.Oct 12 2022, 3:55 PM