SQLBOX_ROLE_HIER_GEN(3) Library Functions Manual SQLBOX_ROLE_HIER_GEN(3)

sqlbox_role_hier_gen
generate hierarchical roles

library “sqlbox”

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

int
sqlbox_role_hier_gen(const struct sqlbox_role_hier *p, struct sqlbox_roles *roles, size_t defrole);

Generate hierarchical roles in roles from p. Any data already set in roles is discarded. Also accepts defrole, the initial role for the system.

sqlbox_role_hier_gen() creates the hierchical system from prior calls to sqlbox_role_hier_child(3) for the hierarchy specification, sqlbox_role_hier_src(3) for permitted database sources, and sqlbox_role_hier_stmt(3) for permitted statements.

On success, the allocated roles are set in roles. These may be freed by later invoking sqlbox_role_hier_gen_free(3).

Returns zero on memory allocation failure or if defrole is not a valid role. An exception to this is if sqlbox_role_hier_alloc(3) was passed zero as the number or roles, in which case defrole must be zero. On success, the pointer must be freed with sqlbox_role_hier_free(3).

sqlbox_role_hier_child(3), sqlbox_role_hier_free(3)
November 7, 2019 OpenBSD 6.5