testing/ostest: extend multiuser identity and permission tests - #3677
Merged
Conversation
Abhishekmishra2808
force-pushed
the
multiuser
branch
from
July 30, 2026 08:43
1139b9f to
9a10fe6
Compare
Use getresuid() and getresgid() for Linux-style id output with name resolution and a groups= list based on the effective GID. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
Add getresuid/setreuid coverage plus ownership and permission checks for message queues, named semaphores, shared memory, and FIFOs. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
Install a minimal passwd file at CONFIG_LIBC_PASSWD_FILEPATH before getpwnam() checks so sim:ostest does not require a pre-built /etc/passwd. Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
Abhishekmishra2808
force-pushed
the
multiuser
branch
from
July 30, 2026 09:53
9a10fe6 to
922944d
Compare
Contributor
Author
|
@acassis PTAL !! |
acassis
approved these changes
Jul 30, 2026
xiaoxiang781216
approved these changes
Jul 30, 2026
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.
Summary
Extends testing/ostest/multiuser.c with regression tests for POSIX credential switching (getresuid/setreuid, saved set-UID/GID) and file/IPC permission enforcement. Enhances NSH id to print real, effective, and saved UID/GID in Linux-style format. Creates a temporary passwd file at build-configured path before getpwnam() checks, so sim:ostest multiuser tests do not need a pre-built /etc/passwd.
Impact
Enables automated validation of multi-user identity and permission behavior when CONFIG_TESTING_OSTEST_MULTIUSER and CONFIG_SCHED_USER_IDENTITY are enabled. The id command output is richer but backward-compatible (same command, more detail). No effect on builds that do not enable multiuser ostest options.
Testing