code wiki / _hdl_build / nx_acl.nx

nx_acl.nx

buildroot/runtime/_hdl_build/nx_acl.nx

5177 B68 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_acl.nx -- GROUPS + ACLs (deepens AUTH-USERS beyond nx_users' owner/other model). POSIX-style: users have a primary gid + supplementary group membership; resources carry owner-uid + owner-gid + 9 permission bits (user rwx / group rwx / other rwx); an access check picks the right class. Sovereign, deterministic. T1 owner gets the USER bits. T2 a group member gets the GROUP bits (r-x: read yes / write no). T3 a non-member gets the OTHER bits. T4 teeth: a non-member is denied; group-write denied when group lacks w. expect_exit: 0 Sovereign: nx_syscalls. NEVER-BRICK: userspace permission logic, 0 firmware.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_g_puts_lib.nx nx_acl.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_g_puts_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts sys_write sys_mmap acl_allow in_group ck g_puts ↻ g_pn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_openat_append sys_write ↻ sys_close sys_exit

structs

none

consts

18const MAXG: i64 = 8 // max groups per user

functions

15func g_pn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
16func ck(name: *u8, c: i64) -> i64 { if c==1 { g_puts(" PASS " as *u8) } else { g_puts(" FAIL " as *u8) } g_puts(name); g_puts("\n" as *u8); return c }
called by 1: main calls 1: g_puts
20func in_group(gmemb: *i64, u: i64, gid: i64) -> i64 { var k: i64=0; while k<MAXG { let g: i64=gmemb[u*MAXG+k]; if g==(0-1) { return 0 } if g==gid { return 1 } k=k+1 } return 0 }
called by 1: acl_allow
23func acl_allow(gmemb: *i64, uid: i64, owner: i64, ogid: i64, perms: i64, wantbit: i64) -> i64
called by 1: main calls 1: in_group
30func main() -> i64