Conversation
- Update .gitignore for development artifacts - Add frozen_string_literal pragma to Gemfile for Ruby 2.7+ compatibility - Update LICENSE copyright to reflect TwilightCoders contributions (2018-2025) - Modernize gemspec: bump Ruby requirement to 2.7+ and update dev dependencies
- Add frozen_string_literal pragmas for better performance - Fix deprecated File.exists? usage (replace with File.exist?) - Add respond_to_missing? for proper method reflection in proxy - Improve code style: use && instead of 'and', remove redundant returns - Add proper module documentation and fix method signatures - Update test expectations for modernized API behavior
- Introduce Sudo::Configuration class with configurable options: - timeout, retries, socket_dir, audit_log, sudo_askpass, load_gems - Add secure socket path generation using SecureRandom - Implement Configuration.inherit() for per-call overrides - Update Wrapper.run() to accept any configuration options via **config - Simplify wrapper constructor to use config object instead of individual parameters - Enable per-instance configuration overrides for all sudo operations - Include comprehensive test suite covering all configuration options and edge cases - Provides foundation for customizable sudo behavior and security improvements
- Replace predictable object_id with SecureRandom.hex(8) for socket paths - Prevents potential socket path prediction attacks
…cture - Add command_base() method for consistent secure command building - Add System.command() method to build secure array-form commands - Fix command injection in kill, unlink, and check methods using array-form system calls - Update wrapper spawn to use secure command arrays instead of string interpolation - Refactor command() and check() to share common base functionality - Update wrapper to handle environment variables properly - Eliminate all string interpolation in system calls to prevent injection attacks
Add SUDO_ASKPASS environment variable and -A flag support to command_base when sudo_askpass is configured, enabling graphical password prompt tools.
- Add `TypeError` handling to `Process.exists?` for more robust PID checking - Extract `socket?` method to eliminate code duplication - Simplify `running?` method with cleaner boolean logic - Use consistent `socket?` method throughout wrapper
Provide cleaner, more intuitive API for simple root operations. Delegates to Wrapper.run but with better semantic naming.
- Add load_gems to Configuration class for consistency - Implement Configuration.inherit() for per-call overrides - Update Wrapper.run() to accept any configuration options via **config_overrides - Simplify wrapper constructor to use config object instead of individual parameters - Enable per-instance configuration: sudo_askpass, timeout, load_gems, etc.
- Update Proxy#loaded_specs to return array of gem names instead of hash - Avoid marshaling Gem::StubSpecification objects which fail in newer Bundler versions - Add error handling with fallback to empty array for robust gem loading - Update corresponding tests to expect array instead of hash
- Add comprehensive CHANGELOG.md with emoji legend and organized release notes - Update README.md with new v0.4.0 features: configuration system, Sudo.as_root DSL, graphical password prompts, and timeouts - Document ASK_PATH_CMD constant for convenient askpass program detection - Fix spelling errors and improve documentation clarity - Update VERSION constant to 0.4.0 for release
gderosa
approved these changes
Jul 24, 2025
Member
|
This look absolutely great. Thanks for running this. Okay to merge imho. |
268c7c5 to
dcf9c70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 Modern Security & Configuration Overhaul
This major release modernizes the
rubysugem with comprehensive security fixes, a flexible configuration system, and enhanced Ruby compatibility.🔒 Security Improvements
kill,unlink, andcheckmethods using array-form system callsSecureRandominstead of predictableobject_id✨ New Features
Configuration System
Sudo.configureblock syntaxConfigurationclass withmethod_missingfor clean property accesstimeout,socket_dir,sudo_askpass,load_gemsEnhanced DSL
Sudo.as_rootconvenience method for simple operationssudo -Aandsudo_askpassconfigurationRuby Compatibility
Bundlermarshaling issues in Ruby 3.2+💥 Breaking Changes
🔧 Internal Improvements
📚 Documentation
Usage Examples
Simple DSL
Configuration
Per-wrapper overrides