Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-process-util: Handle unprivileged setrlimit success
Currently test_setpriority_closest assumes that setting RLIMIT_NICE to 30 will fail if the process is unprivileged. If it succeeds, it assumes that the process is privileged and setresuid and setresgid will succeed. However, if RLIMIT_NICE is already >= 30, then setrlimit will succeed even if the process is unprivileged. Guard against that by checking for permission errors in setresuid and setresgid and skipping the full test if so. Fixes #22896. (cherry picked from commit 9217255)
- Loading branch information