https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a440f5edd8a06517996d2d2a2586982d51a2fa75

commit a440f5edd8a06517996d2d2a2586982d51a2fa75
Author:     Corinna Vinschen <[email protected]>
AuthorDate: Sun Jan 25 23:30:56 2026 +0100
Commit:     Corinna Vinschen <[email protected]>
CommitDate: Fri Feb 13 20:23:36 2026 +0100

    Cygwin: setrlimit: Allow admin users to raise hard limit
    
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/resource.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/resource.cc b/winsup/cygwin/resource.cc
index 5ec436c2cfa4..9dfe36b13e36 100644
--- a/winsup/cygwin/resource.cc
+++ b/winsup/cygwin/resource.cc
@@ -314,7 +314,8 @@ setrlimit (int resource, const struct rlimit *rlp)
          __leave;
        }
 
-      if (rlp->rlim_cur > oldlimits.rlim_max)
+      if (rlp->rlim_max > oldlimits.rlim_max
+         && !check_token_membership (well_known_admins_sid))
        {
          set_errno (EPERM);
          __leave;

Reply via email to