Lines Matching +full:last +full:- +full:level

85     for(l = limits; l->name != NULL; l++)  in find_limit()
86 if(strcasecmp(name, l->name) == 0) in find_limit()
94 "-" no limits,
113 return -1; in read_limits_conf()
117 char *last = NULL; in read_limits_conf() local
119 int level; in read_limits_conf() local
127 if(buf[strlen(buf) - 1] != '\n') { in read_limits_conf()
143 if((args[0] = strtok_r(buf, " \t", &last)) == NULL || in read_limits_conf()
144 (args[1] = strtok_r(NULL, " \t", &last)) == NULL || in read_limits_conf()
145 (args[2] = strtok_r(NULL, " \t", &last)) == NULL || in read_limits_conf()
146 (args[3] = strtok_r(NULL, " \t", &last)) == NULL) { in read_limits_conf()
157 if(strcmp(args[3], "-") == 0) { in read_limits_conf()
170 if(value * l->scale < value) in read_limits_conf()
173 value *= l->scale; in read_limits_conf()
175 level = 0; in read_limits_conf()
178 if(strcmp(args[0], pwd->pw_name) == 0) in read_limits_conf()
179 level = 3; in read_limits_conf()
183 if(gr != NULL && gr->gr_gid == pwd->pw_gid) in read_limits_conf()
184 level = 2; in read_limits_conf()
187 level = 1; in read_limits_conf()
188 if(level == 0 || level < l->has_limit) /* not for us */ in read_limits_conf()
190 if(l->has_limit < level) { in read_limits_conf()
191 if(getrlimit(l->resource, &l->limit) < 0) in read_limits_conf()
193 l->has_limit = level; in read_limits_conf()
198 if(strcasecmp(args[1], "soft") == 0 || strcmp(args[1], "-") == 0) in read_limits_conf()
199 l->limit.rlim_cur = value; in read_limits_conf()
200 if(strcasecmp(args[1], "hard") == 0 || strcmp(args[1], "-") == 0) in read_limits_conf()
201 l->limit.rlim_max = value; in read_limits_conf()
204 for(l = limits; l->name != NULL; l++) { in read_limits_conf()
205 if(l->has_limit) { in read_limits_conf()
206 if(l->limit.rlim_cur > l->limit.rlim_max) in read_limits_conf()
207 l->limit.rlim_cur = l->limit.rlim_max; in read_limits_conf()
208 if(setrlimit(l->resource, &l->limit) != 0) in read_limits_conf()
209 syslog(LOG_ERR, "setrlimit RLIM_%s failed: %m", l->name); in read_limits_conf()
211 l->has_limit = 0; in read_limits_conf()