HomeFreeBSD

comsat: Improve use of setuid()

Description

comsat: Improve use of setuid()

Just return from jkfprintf if either (a) user lookup fails (that is,
getpwnam fails) or (b) setuid() to the user's uid fails. If comsat is
invoked from inetd using the default of tty:tty we will now return due
to setuid() failing rather than fopen() failing.

PR: 270404
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47823

(cherry picked from commit 062b69ba045dc0fef3d9b8d73365d2798c05a480)

Details

Provenance
emasteAuthored on Nov 27 2024, 8:36 PM
Reviewer
kevans
Differential Revision
Restricted Differential Revision
Parents
rG2d7d4c66269d: llvm19: permit incremental builds from llvm18
Branches
Unknown
Tags
Unknown

Event Timeline

emaste added an edge: Restricted Differential Revision.