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)
Mon, Nov 18, 10:17 PM
Unknown Object (File)
Mon, Nov 18, 10:11 PM
Unknown Object (File)
Oct 4 2024, 1:52 AM
Unknown Object (File)
Sep 28 2024, 11:40 AM
Unknown Object (File)
Sep 25 2024, 4:39 PM
Unknown Object (File)
Sep 25 2024, 4:39 PM
Unknown Object (File)
Sep 25 2024, 4:39 PM
Unknown Object (File)
Sep 25 2024, 4:38 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