code wiki / _hdl_build / nx_acl.nx
nx_acl.nx
buildroot/runtime/_hdl_build/nx_acl.nx
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
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
structs
| none |
consts
| 18 | const MAXG: i64 = 8 // max groups per user |
functions
| 15 | func g_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 16 | func 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 } |
| 20 | func 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 |
| 23 | func acl_allow(gmemb: *i64, uid: i64, owner: i64, ogid: i64, perms: i64, wantbit: i64) -> i64 |
| 30 | func main() -> i64 |