code wiki / _hdl_build / nx_account_cleanup.nx

nx_account_cleanup.nx

buildroot/runtime/_hdl_build/nx_account_cleanup.nx

7179 B145 linesdepth 13pulls 37 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_account_cleanup.nx -- one-shot sovereign cleanup of the nishifamily OPAQUE account store. Keeps ONLY elderwesto: its main credential AND its "|rec" recovery credential, both computed from the REAL derivation (nx_ncs_derive_user_id_hash, same path register/login use) -- never from a guess. Every OTHER identity in the store is SOFT-disabled (append is_current=0; additive-only per global rule 13 -- history sacred, fully reversible by re-appending is_current=1). SAFETY: * FAIL-CLOSED: if elderwesto's main uid is NOT present in the store (realm/derivation mismatch), ABORT and disable nobody (negative control against a wrong realm wiping the real account). * DRY-RUN: with AC_DRYRUN=1 it only PRINTS what it would do (read the output before flipping to 0). * IDEMPOTENT (rule 10): an identity whose latest row is already is_current=0 is skipped. Run AFTER backing up the store. Store path = the live NAS store via the homes drvfs mount. COMPOSES: hub/nx_user_account_store (nx_uas_append + _uas_hex_dec), hub/nx_no_cookie_session (derive).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_user_account_store.nx nx_no_cookie_session.nx nx_account_cleanup.nx

imports: nx_syscalls.nxnx_user_account_store.nxnx_no_cookie_session.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap nx_ncs_derive_user_id_hash sys_mmap ↻ ac_puts sys_write ac_put_hex sys_mmap ↻ sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit _uas_hex_dec _uas_nib ac_eq32 ac_cpy ac_put_i64 sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real nx_uas_append sys_mmap ↻ _uas_hex_enc _uas_i64_hex16 sys_openat_append sys_write ↻ sys_fsync sys_close ↻

structs

none

consts

20const AC_DRYRUN: i64 = 0
21const AC_STORE: *u8 = "/mnt/nas_homes/elderwesto/nishihost/opaque_store.log"
22const AC_REALM: *u8 = "nishi_site_admin"
23const AC_REALM_N: i64 = 16
24const AC_MAXACC: i64 = 256

functions

26func ac_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return n }
called by 1: main calls 1: sys_write
27func ac_put_hex(b: *u8, n: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
34func ac_put_i64(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
42func ac_eq32(a: *u8, b: *u8) -> i64
called by 1: main
47func ac_cpy(dst: *u8, src: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[i] = src[i]; i = i + 1 } return n }
called by 1: main
49func main(argc: i64, argv: *i64) -> i64