Bug 20542 - PAM doesn't set RLIMIT_LOCKS when compiled against glibc-2.2 headers
PAM doesn't set RLIMIT_LOCKS when compiled against glibc-2.2 headers
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: pam (Show other bugs)
7.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-08 17:14 EST by Jes Sorensen
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-08 17:14:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jes Sorensen 2000-11-08 17:14:44 EST
Hi

PAM from RH7 and rawhide does not know about RLIMIT_LOCKS, however it uses
RLIM_NLIMITS which includes the count for RLIMIT_LOCKS. Thus when PAM sets
the default lock values RLIMIT_LOCKS.{SOFT,HARD} will be set to zero. Then
if one tries to logon to a kernel-2.4 based system and grab a file lock it
will fail as the limit is zero ... happens when trying to use sendmail for
instance.

Patch attached.

Jes

--- pam-0.72/modules/pam_limits/pam_limits.c-old	Wed Nov  8 16:57:14 2000
+++ pam-0.72/modules/pam_limits/pam_limits.c	Wed Nov  8 16:59:27 2000
@@ -272,11 +272,17 @@
     retval |= getrlimit(RLIMIT_AS,      &limits[RLIMIT_AS].limit);
     limits[RLIMIT_AS].src_soft = LIMITS_DEF_NONE;
     limits[RLIMIT_AS].src_hard = LIMITS_DEF_NONE;
+
+#ifdef RLIMIT_LOCKS
+    retval |= getrlimit(RLIMIT_LOCKS,   &limits[RLIMIT_LOCKS].limit);
+    limits[RLIMIT_LOCKS].src_soft = LIMITS_DEF_NONE;
+    limits[RLIMIT_LOCKS].src_hard = LIMITS_DEF_NONE;
+#endif
     priority = 0;
     login_limit = -2;
     login_limit_def = LIMITS_DEF_NONE;
     return retval;
-}    
+}
 
 static void process_limit(int source, const char *lim_type,
 			  const char *lim_item, const char *lim_value,
@@ -315,6 +321,10 @@
 	limit_item = RLIMIT_MEMLOCK;
     else if (strcmp(lim_item, "as") == 0)
 	limit_item = RLIMIT_AS;
+#ifdef RLIMIT_LOCKS
+    else if (strcmp(lim_item, "locks") == 0)
+	limit_item = RLIMIT_LOCKS;
+#endif
     else if (strcmp(lim_item, "maxlogins") == 0) {
 	limit_item = LIMIT_LOGIN;
 	flag_numsyslogins = 0;
Comment 1 Nalin Dahyabhai 2000-11-20 19:03:44 EST
Thanks.  This will be included in the next Raw Hide release.

Note You need to log in before you can comment on or make changes to this bug.