From: Corinna Vinschen <[email protected]>

Signed-off-by: Corinna Vinschen <[email protected]>
---
 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;
-- 
2.52.0

Reply via email to