--- pam_limits.c.ori 2017-05-16 09:44:02.819262851 -0600 +++ pam_limits.c 2017-05-16 09:44:48.131237292 -0600 @@ -691,6 +691,9 @@ return LIMIT_RANGE_NONE; ++pmax; + if (range[0]=='*') + return LIMIT_RANGE_NONE; + if (range[0] == '@' || range[0] == '%') ++range; @@ -854,9 +857,14 @@ } else { switch(rngtype) { case LIMIT_RANGE_NONE: - if (strcmp(domain, "*") == 0) + if (strcmp(domain,"*")==0) { // process for everyone, except for root (next line) + if ( uid==0) { //don't process root limits unless specified in the config file + break; // fall out of switch/case because we are root + } else { // we aren't root, so let's go ahead and set the limits process_limit(pamh, LIMITS_DEF_DEFAULT, ltype, item, value, ctrl, pl); + } + } break; case LIMIT_RANGE_ONE: if (uid != max_uid)