static int kpersona_dealloc_syscall(user_addr_t idp)
{
- int error;
+ int error = 0;
uid_t persona_id;
struct persona *persona;
if (error)
return error;
- persona = persona_lookup(persona_id);
+ /* invalidate the persona (deny subsequent spawn/fork) */
+ persona = persona_lookup_and_invalidate(persona_id);
+
if (!persona)
return ESRCH;
- /* invalidate the persona (deny subsequent spawn/fork) */
- error = persona_invalidate(persona);
-
/* one reference from the _lookup() */
persona_put(persona);
/* one reference from the _alloc() */
- if (!error)
- persona_put(persona);
+ persona_put(persona);
return error;
}
kinfo.persona_id = persona->pna_id;
kinfo.persona_type = persona->pna_type;
kinfo.persona_gid = persona_get_gid(persona);
- int ngroups = 0;
+ unsigned ngroups = 0;
persona_get_groups(persona, &ngroups, kinfo.persona_groups, NGROUPS);
kinfo.persona_ngroups = ngroups;
kinfo.persona_gmuid = persona_get_gmuid(persona);
kinfo.persona_id = persona->pna_id;
kinfo.persona_type = persona->pna_type;
kinfo.persona_gid = persona_get_gid(persona);
- int ngroups = 0;
+ unsigned ngroups = 0;
persona_get_groups(persona, &ngroups, kinfo.persona_groups, NGROUPS);
kinfo.persona_ngroups = ngroups;
kinfo.persona_gmuid = persona_get_gmuid(persona);