The aio kthreads start off with a root credential just like all other

kthreads, so don't malloc a ucred just so we can create a duplicate of the
one we already have.
This commit is contained in:
John Baldwin 2001-10-05 17:55:11 +00:00
parent 34c5f03685
commit 43150722c9

View file

@ -695,16 +695,9 @@ aio_daemon(void *uproc)
/*
* Get rid of our current filedescriptors. AIOD's don't need any
* filedescriptors, except as temporarily inherited from the client.
* Credentials are also cloned, and made equivalent to "root".
*/
fdfree(td);
mycp->p_fd = NULL;
mycp->p_ucred = crcopy(mycp->p_ucred);
mycp->p_ucred->cr_uid = 0;
uifree(mycp->p_ucred->cr_uidinfo);
mycp->p_ucred->cr_uidinfo = uifind(0);
mycp->p_ucred->cr_ngroups = 1;
mycp->p_ucred->cr_groups[0] = 1;
/* The daemon resides in its own pgrp. */
enterpgrp(mycp, mycp->p_pid, 1);