You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What was the motivation to change the current way of obtaining the users? any issues?
For me, running an external binary is a no-no by default, specially when getent passwd just returns the content of /etc/passwd.
Thank you for the feedback. I’d like to clarify the use case behind this change.
My working environment uses FreeIPA, with users synchronized from Active Directory. These are domain/centralized users managed through NSS/SSSD rather than static local accounts in /etc/passwd.
The current implementation using pwd.getpwall() only returns local users from /etc/passwd. As a result, the synchronized FreeIPA/AD users cannot be listed or resolved in the UI, even though they have valid UIDs and can run processes on the system.
This prevents administrators from creating UID-based network rules for those domain users, which is an important use case in enterprise environments.
getent passwd follows the system NSS configuration (/etc/nsswitch.conf), so it can return both local users and users provided by sources such as SSSD, FreeIPA, LDAP, or AD integration. This allows OpenSnitch to resolve the actual UID/user mappings visible to the operating system.
I understand the concern about invoking an external binary. The intention is not to replace the local-user behavior, but to use the standard NSS-aware mechanism so that UID rules also work correctly for centralized identity environments. The command can be invoked without shell interpolation, and user-provided values can be passed as arguments directly to avoid command-injection risks.
In short, this change is needed because reading /etc/passwd alone is not sufficient for systems using centralized identity management.
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
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.
Summary
getent passwdto populate local UID rule users instead ofpwd.getpwall()pwd.getpwnam, localgetent, and remote non-interactive SSHgetentuidCombofrom handling invalid indexes when users type custom textTesting
python3 -m py_compile ui/opensnitch/dialogs/ruleseditor/dialog.py ui/opensnitch/nodes.py ui/tests/dialogs/test_ruleseditor.py ui/tests/ test_nodes.pygit diff --checkNote: targeted pytest collection could not run in this local environment because the Python
grpcmodule is missing.