code wiki / _hdl_build / nx_aw_sudo.nx
nx_aw_sudo.nx
buildroot/runtime/_hdl_build/nx_aw_sudo.nx
about
nx_aw_sudo.nx -- run a command as ROOT on the NAS via `sudo -S`, feeding the vault-held elderwesto
password to sudo's stdin over the sovereign SSH channel. (sudo -l confirms: elderwesto may run
(ALL) ALL with a password.) The root command is read from awsudo.cmd and MUST begin "sudo -S ".
Spine cloned from nx_aw_push (vault unlock + ssh_put_file stream); here the STREAMED stdin is the
password (+newline) that sudo consumes. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_ssh_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
| 8 | const S_MAGIC_1000000: i64 = 1000000 |
| 9 | const S_MAGIC_65536: i64 = 65536 |
| 10 | const S_MAGIC_1048576: i64 = 1048576 |
| 11 | const S_MAGIC_16384: i64 = 16384 |
| 12 | const S_MAGIC_1024: i64 = 1024 |
| 14 | const S_CMD: *u8 = "/mnt/c/Users/elder/AppData/Local/Temp/awsudo.cmd" as *u8 |
| 15 | const S_SECRET_OUT: *u8 = "/tmp/nxsecret.out" as *u8 |
| 16 | const S_VAULT_NV: *u8 = "/home/elderwesto/.nishi/secrets/nas.nv" as *u8 |
functions
| 18 | func s_run(path: *u8, a1: *u8, a2: *u8) -> i64 |
| 36 | func s_unlink(path: *u8) -> i64 { __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) return 0 } called by 1: main |
| 37 | func s_napms(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0] = 0; ts[1] = ms * S_MAGIC_1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 39 | func s_drain(st: *SshState) -> i64 |
| 48 | func s_put(st: *SshState, wcmd: *u8, wcmdlen: i64, data: *u8, datalen: i64) -> i64 |
| 88 | func main(argc: i64, argv: *i64) -> i64 |