Page MenuHomeFreeBSD

mail: Don't trap signals we shouldn't.
ClosedPublic

Authored by des on Apr 24 2025, 10:03 PM.
Tags
None
Referenced Files
F165023660: D50011.id154342.diff
Wed, Aug 5, 9:05 AM
Unknown Object (File)
Fri, Jul 24, 2:02 PM
Unknown Object (File)
Tue, Jul 21, 2:53 AM
Unknown Object (File)
Jun 22 2026, 2:13 PM
Unknown Object (File)
Jun 21 2026, 7:38 AM
Unknown Object (File)
Jun 16 2026, 8:50 AM
Unknown Object (File)
Jun 7 2026, 4:46 AM
Unknown Object (File)
Jun 5 2026, 6:21 PM
Subscribers

Details

Summary

When in interactive mode, trap SIGINT, SIGHUP, and tty-related signals.
Otherwise, leave signals untouched as required by POSIX.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

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

Event Timeline

des requested review of this revision.Apr 24 2025, 10:03 PM
kevans added inline comments.
usr.bin/mail/collect.c
82–85

Looking at the standard, it's not clear to me that this is actually correct. ASYNCHRONOUS EVENTS explciitly spells out ignore handling only in the interactive case as something evaluated when a SIGINT rolls in, and otherwise has:

When mailx is in Send Mode and standard input is not a terminal, it shall take the standard action for all signals.

I think we should continue to leave SIGINT alone in the non-interactive case.

This revision is now accepted and ready to land.Apr 25 2025, 1:56 PM
This revision was automatically updated to reflect the committed changes.