HomeFreeBSD

Open-code proc_set_cred_init()

Description

Open-code proc_set_cred_init()

This function is to be called only when initializing a new process (so,
'proc0' and at fork), and not in any other circumstances. Setting the
process' 'p_ucred' field to the result of crcowget() on the original
credentials is the only thing it does, hiding the fact that the process'
'p_ucred' field is crushed by the call. Moreover, most of the code it
executes is already encapsulated in crcowget().

To prevent misuse and improve code readability, just remove this
function and replace it with a direct assignment to 'p_ucred'.

Reviewed by: markj (earlier version), kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42255

(cherry picked from commit 92541c12bc25c59333d7f3b0721b6b16aaff3644)

Details

Provenance
olceAuthored on Sep 25 2023, 8:48 AM
Reviewer
markj
Differential Revision
D42255: Open-code proc_set_cred_init()
Parents
rG635c2b82f60e: pf tests: check cleared time when zeroing stats for table addresses
Branches
Unknown
Tags
Unknown