calendar: don't setlogin(2) in the -a user handlers
As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a`
will now fork off a new process for each user and do all of its own
processing in the user's own context.
As a side-effect, calendar(1) started calling setlogin(2) in each of the
forked processes and inadvertently hijacked the login name for the
session it was running under, which was typically not a fresh session
but rather that of whatever cron/periodic run spawned it. Thus, daily
and security e-mails started coming from completely arbitrary user.
We could create a new session, but it appears that nothing calendar(1)
does really needs the login name to be clobbered; opt to just avoid the
setlogin(2) call entirely rather than incur the overhead of a new
session for each process.
PR: 280418
Reviewed by: des, olce
[3 lines not shown]
route: avoid overlapping strcpy
Passing overlapping buffers to strcpy yields an undefined result, so
let's avoid it. The copy doesn't really need to happen anyways, we can
just point to the domain part of the hostname.
This was discovered with _FORTIFY_SOURCE.
Sponsored by: Klara, Inc.
Sponsored by: Stormshield
Reviewed by: allanjude, emaste, imp, melifaro (all previous version)
(cherry picked from commit 158f319428c10143ce2ffe766416207c75578931)
nd6: Fix the routing table subscription
The nd6 code listens for RTM_DELETE events so that it can mark the
corresponding default router as inactive in the case where the default
route is deleted. A subsequent RA from the router may then reinstall
the default route.
Commit fedeb08b6a58e broke this for non-multipath routes, as
rib_decompose_notification() only invokes the callback for multipath
routes. Restore the old behaviour. Also ensure that we update the
router only for RTM_DELETE notifications, lost in commit 2259a03020fe0.
Reviewed by: bz
Fixes: fedeb08b6a58 ("Introduce scalable route multipath.")
Fixes: 2259a03020fe ("Rework part of routing code to reduce difference to D26449.")
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Sponsored by: Bell Tower Integration
Differential Revision: https://reviews.freebsd.org/D46020
[2 lines not shown]
cxgbe: Flush transmitted packets more regularly in netmap mode
Previously, when transmitting short runs of packets via cxgbe_nm_tx(),
we would wait until a large number of packets were buffered before
scheduling a task to clean transmit buffers.
Obtained from: np
(cherry picked from commit 6af3d59962449c66688361598163dd174cc5fb2a)
dtrace: Avoid including dtrace_isa.c directly into dtrace.c
This was done in the original DTrace import, presumably because that
made it a bit easier to handle includes. However, this can cause
dtrace_getpcstack() to be inlined into dtrace_probe(), resulting in a
missing frame in stack traces since dtrace_getpcstack() takes care to
bump "aframes" to account for its own stack frame.
To avoid this, compile dtrace_isa.c separately on all platforms. Add
requisite includes.
MFC after: 2 weeks
Sponsored by: Innovate UK
(cherry picked from commit 82283cad12a417abfb1469d899b2d7cfb1d38f77)