sqlbox_role_hier_startadd a start (source) node to a hierarchy

library “sqlbox”

#include <stdint.h>
#include <sqlbox.h>

sqlbox_role_hier_start(struct sqlbox_role_hier *p, size_t start);

Set start such that it may transition into any other role in p but that no other role may transition into it. These are usually called "sources" but called starting nodes to disambiguate from sqlbox_role_hier_src(3). The node may not already be the parent or child of any other node as set with sqlbox_role_hier_child(3) nor a sink node. There may be multiple starting nodes. Setting multiple times as a start is a no-op.

A start has sibling transition to all other nodes: it will not inherit any permissions from other nodes.

Returns zero if start is not a valid role, has already been assigned as a child or parent, is a sink, or memory allocation fails. Returns non-zero otherwise.


December 2, 2023 OpenBSD 7.4