mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-20 04:58:29 +00:00
Fix real correctness/security gaps found during review, on top of the network sync and CLI completion work: - pkg_install(): commit the installed database before writing the current/previous pointer files, and before advancing transaction state past ACTIVATED. Those are recovery bookkeeping and convenience mirrors respectively - once the installed database itself is durably committed, a failure to refresh either one must not trigger the failure-cleanup path, which could otherwise delete a payload the database now legitimately points at. Also stop treating an existing version directory as newly created when reinstalling an already-installed version, so a failed reinstall can't delete a working install. - pkg_uninstall()/pkg_rollback(): acquire the per-package install lock in addition to the installed-db lock, drop the entry from the authoritative database first, and only then remove payload files - a crash between those two steps can leave orphaned files, which are reclaimable, but never leaves the database pointing at a payload that's already gone. - pkg_sync(): stage each sync to a PID-qualified temp filename instead of a single fixed name, so concurrent sync calls can no longer race on the same staging file. Return real negative errno codes instead of EXIT_SUCCESS/EXIT_FAILURE, matching the rest of this API; pkg_main.c maps that back to a process exit code at the CLI boundary. - pkg_metadata_parse_installed_entry(): validate that name/current/ previous/every entry in versions[] are safe path components, and that current (and previous, if set) actually appear in versions[] - a corrupted or tampered installed-packages database can no longer reference a nonexistent version or smuggle a path-traversal sequence through a field this code already trusted implicitly. - pkg_store_write_all()/pkg_repo_sink(): treat a zero-byte write() as -EIO instead of looping on it silently. - Removed the malloc()-falls-back-to-kmm_malloc() logic in pkg_malloc/ pkg_zalloc/pkg_realloc/pkg_free entirely - it required tracking which allocator owned a given pointer via kmm_heapmember(), which is specific to this target's flat, single-heap memory model and not a sound general application API. These are now plain wrappers around malloc/calloc/realloc/free. - Added pkg_metadata_load_manifest_path(), so a caller (e.g. the nxstore GUI frontend, launching an installed package) can load the manifest actually recorded for a specific installed version, instead of combining a rollback-selected version with whatever the current catalog happens to describe for that package name - those can disagree after a rollback if the catalog has since moved on. - Storage root default changed from /tmp/nxpkg to /var/lib/nxpkg, following the conventional persistent application-data location instead of a path whose own name suggests non-persistent storage. A board without persistent storage mounted at /var, or that wants a different location (e.g. an SD card), still overrides this via CONFIG_SYSTEM_NXPKG_ROOT as before. - Moved system/nxpkg/README.txt into the companion NuttX documentation PR rather than shipping user-facing documentation as an in-tree README. Assisted-by: Claude:claude-sonnet-5 Signed-off-by: aviralgarg05 <gargaviral99@gmail.com> |
||
|---|---|---|
| .. | ||
| adb | ||
| adcscope | ||
| argtable3 | ||
| batterydump | ||
| cdcacm | ||
| cfgdata | ||
| cle | ||
| composite | ||
| conntrack | ||
| coredump | ||
| cpuload | ||
| critmon | ||
| cu | ||
| curl | ||
| dd | ||
| debugpoint | ||
| dhcp6c | ||
| dhcpc | ||
| dumpstack | ||
| fastboot | ||
| fdt | ||
| flash_eraseall | ||
| flatbuffers | ||
| gcov | ||
| gdbstub | ||
| gprof | ||
| hex2bin | ||
| hexed | ||
| hostname | ||
| i2c | ||
| iptables | ||
| irtest | ||
| libffi | ||
| libuv | ||
| lm75 | ||
| lsan | ||
| lzf | ||
| mdio | ||
| microros | ||
| netdb | ||
| nsh | ||
| ntpc | ||
| nxcamera | ||
| nxcodec | ||
| nxdiag | ||
| nxinit | ||
| nxlooper | ||
| nxmbclient | ||
| nxpkg | ||
| nxplayer | ||
| nxrecorder | ||
| ofloader | ||
| ping | ||
| ping6 | ||
| popen | ||
| psmq | ||
| ptpd | ||
| readline | ||
| resmonitor | ||
| sched_note | ||
| sensorscope | ||
| sensortest | ||
| setlogmask | ||
| settings | ||
| smf | ||
| spi | ||
| stackmonitor | ||
| syslogd | ||
| system | ||
| taskset | ||
| tcpdump | ||
| tee | ||
| telnet | ||
| telnetd | ||
| termcurses | ||
| trace | ||
| ubloxmodem | ||
| uniqueid | ||
| uorb | ||
| usbmsc | ||
| vi | ||
| vncviewer | ||
| ymodem | ||
| zlib | ||
| zmodem | ||
| .gitignore | ||
| CMakeLists.txt | ||
| Make.defs | ||
| Makefile | ||