[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: More pam_limits trouble



* Ben Collins said:

> > It accepts only, e.g.:
> > 
> > grendel     -      cpu      [digit] 
> > 
> > Which is of no use, because setting the limit to 0 doesn't mean disabling
> > it... Any advice? :)
> 
> Hmmm...looking at the source, it wont accept a line with less than 4 arguments,
> yet you are correct that the documentation say otherwise. Let me work on this.
> I'll have it fixed in the next upload.
I have attached a quick (and untested - I didn't have time to compile :((()
fix. From looking at it, it should do.

marek
--- pam_limits.c.orig	Thu Jul  8 07:01:58 1999
+++ pam_limits.c	Thu Sep 16 16:46:06 1999
@@ -466,7 +466,14 @@
                     process_limit(LIMITS_DEF_GROUP, ltype, item, value, ctrl);
             } else if (strcmp(domain, "*") == 0)
                 process_limit(LIMITS_DEF_DEFAULT, ltype, item, value, ctrl);
-        } else
+        } else if ( i == 2 ) { /* Probably a no-limit line */
+	    if ( (strcmp(uname, domain) != 0) && (ltype[0] == '-') ) {
+		_pam_log(LOG_DEBUG, "no limits for '%s'", uname);
+		fclose(fil)
+		return PAM_SUCCESS;
+	    } else
+		_pam_log(LOG_DEBUG,"invalid line '%s'", buf);
+	} else
             _pam_log(LOG_DEBUG,"invalid line '%s'", buf);
     }
     fclose(fil);

Attachment: pgpxuGXDlwz6h.pgp
Description: PGP signature


Reply to: