Skip to main content
← All Internal Releases

nanx v0.2.1

Internal
2025-12-29

Release Date: 2025-12-29

Previous Version: v0.2.0-alpha.24

Summary

This patch release introduces automatic privilege elevation for self-update operations in nanx. The update mechanism now intelligently detects when elevated permissions are required and automatically re-executes with sudo when necessary, improving the user experience during binary updates on Unix-like systems.

Features

Automatic Privilege Elevation for Self-Updates

  • [nanions::self_cmd::update::installer] Implemented automatic permission detection and sudo re-execution for the update command
- Added needs_elevated_permissions() function to detect if the binary location requires elevated access (checks write permissions on parent directory and binary itself)

- Added is_elevated() function to determine if the current process already has root/administrator privileges

- Implemented automatic re-execution with sudo when elevated permissions are needed but not present

- Enhanced error messages to clearly indicate permission issues and guide users

- Supports both Unix-like systems (Linux, macOS) with proper permission checking via std::fs::metadata()

This feature eliminates the common friction point where users would encounter permission denied errors during self-updates and had to manually retry with sudo. The installer now handles this automatically while preserving security by only elevating when actually necessary.

Statistics

MetricValue
Commits2
Files Changed2
Lines+74 / -1
Issues Closed0

Contributors

NameCommitsLines
VivinMeth ([email protected])2+74 / -1