Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libsepol/cil: Properly reset an anonymous classperm set
In struct cil_classperms_set, the "set" field is a pointer to a struct cil_classpermission. Normally the classpermission is created in a classpermissionset rule with a name declared in a classpermission rule and stored in a symbol table. Commit c49a8ea ("libsepol/cil: cil_reset_classperms_set() should not reset classpermission") fixed the resetting of classperms sets by setting the "set" field to NULL rather than resetting the classpermission that it pointed to. But this fix mixed the special case where an anonymous classperm set is passed as an argument to a call. In this case the classpermission is not named and not stored in a symtab, it is created just for the classperms set and its classperms list needs to be reset. Reset the classperms list if the classperms set is anonymous (which is when the datum name is NULL). Signed-off-by: James Carter <jwcart2@gmail.com>
- Loading branch information