Subject: kauth_cred_set* change proposal
To: None <tech-kern@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 07/02/2006 16:24:23
unless anyone objects, i'll make kauth_cred_set*() return
a new credential and remove kauth_cred_copy.
ie. something like the following.
kauth_cred_t
kauth_cred_setuid(kauth_cred_t cred, uid_t uid)
{
kauth_cred_t newcred;
if (cred->cr_uid == uid) {
return cred;
}
if (cred->cr_refcnt == 1) {
cred->cr_uid = uid;
return cred;
}
newcred = kauth_cred_dup(cred);
kauth_cred_free(cred);
newcred->cr_uid = uid;
return newcred;
}
YAMAMOTO Takashi