code wiki / _hdl_build / nx_cms_blocks_gate.nx
nx_cms_blocks_gate.nx
buildroot/runtime/_hdl_build/nx_cms_blocks_gate.nx
about
nx_cms_blocks_gate.nx -- CMS C11 GATE (re-runnable, evidence-driven): BLOCK EDITOR + UPLOADS at
the wire (the Gutenberg + media-library class). Proves: blocks render through the TEAM-AUTHORED
_pe_blockr (TEMPLATE_TABLE, emit12) in document order; rich blocks sanitized ON WRITE; image
uploads are REAL multipart (nx_multipart) and pass only when magic bytes MATCH the extension,
size is within the site's upload.conf cap (config DATA), and the name is traversal-proof; served
uploads come back BYTE-IDENTICAL with the right Content-Type; block ops are session+CSRF guarded.
Appends "CMSGATE row=nx_cms_blocks ... verdict=PASS|FAIL". Exit 0 iff all rows pass.
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_cms_store.nxnx_connect.nxnx_sha256.nxnx_syscalls.nxnx_kill_portable.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
| 15 | const KB_PORT: i64 = 8085 |
| 16 | const KB_SITE: *u8 = "/tmp/_cms_blocks_site" |
functions
| 18 | func kb_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func kb_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 20 | func kb_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 26 | func kb_catn(dst: *u8, off: i64, s: *u8, n: i64) -> i64 |
| 32 | func kb_index(hay: *u8, n: i64, needle: *u8) -> i64 |
| 44 | func kb_has(hay: *u8, n: i64, needle: *u8) -> i64 { if kb_index(hay, n, needle) >= 0 { return 1 } return 0 } |
| 46 | func kb_http(req: *u8, rl: i64, resp: *u8, cap: i64) -> i64 called by 1: main calls 7: sys_socketsys_mmapnx_connect_boundedsys_closesys_writesys_set_socket_timeout+1 |
| 80 | func kb_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64 |
| 103 | func kb_post_mp(req: *u8, path: *u8, cookie: *u8, body: *u8, blen: i64) -> i64 |
| 124 | func kb_get(req: *u8, path: *u8, cookie: *u8) -> i64 |
| 138 | func kb_mp_body(out: *u8, csrf: *u8, fname: *u8, pay: *u8, plen: i64) -> i64 |
| 149 | func kb_row(id: i64, ok: i64, what: *u8) -> i64 |
| 159 | func kb_mkdir(path: *u8, mode: i64) -> i64 |
| 164 | func kb_writefile(path: *u8, buf: *u8, n: i64) -> i64 |
| 172 | func main() -> i64 |