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

Details

Provenance
olceAuthored on Sep 25 2023, 8:48 AM
markjCommitted on Nov 2 2023, 1:30 PM
Reviewer
markj
Differential Revision
D42255: Open-code proc_set_cred_init()
Parents
rG63bf943d4af1: Hyper-V: vmbus: Add NULL check for vmbus_res
Branches
Unknown
Tags
Unknown