Lines 185-191
Link Here
|
185 |
* [Kk]: k = file creation masK (umask) |
185 |
* [Kk]: k = file creation masK (umask) |
186 |
* [Ll]: l = max number of logins for this user |
186 |
* [Ll]: l = max number of logins for this user |
187 |
* [Pp]: p = process priority -20..20 (negative = high, positive = low) |
187 |
* [Pp]: p = process priority -20..20 (negative = high, positive = low) |
188 |
* |
188 |
* [Ii]: i = RLIMIT_NICE max nice value (0..39 translates to 20..-19) |
|
|
189 |
* [Oo]: o = RLIMIT_RTPRIO max real time priority (linux/sched.h 0..MAX_RT_PRIO) |
189 |
* Return value: |
190 |
* Return value: |
190 |
* 0 = okay, of course |
191 |
* 0 = okay, of course |
191 |
* LOGIN_ERROR_RLIMIT = error setting some RLIMIT |
192 |
* LOGIN_ERROR_RLIMIT = error setting some RLIMIT |
Lines 273-278
Link Here
|
273 |
retval |= setrlimit_value (RLIMIT_STACK, pp, 1024); |
274 |
retval |= setrlimit_value (RLIMIT_STACK, pp, 1024); |
274 |
break; |
275 |
break; |
275 |
#endif |
276 |
#endif |
|
|
277 |
#ifdef RLIMIT_NICE |
278 |
case 'i': |
279 |
case 'I': |
280 |
/* RLIMIT_NICE - max scheduling priority (0..39) */ |
281 |
retval |= setrlimit_value (RLIMIT_NICE, pp, 1); |
282 |
break; |
283 |
#endif |
284 |
#ifdef RLIMIT_RTPRIO |
285 |
case 'o': |
286 |
case 'O': |
287 |
/* RLIMIT_RTPRIO - max real time priority (0..MAX_RT_PRIO) */ |
288 |
retval |= setrlimit_value (RLIMIT_RTPRIO, pp, 1); |
289 |
break; |
290 |
#endif |
276 |
case 'k': |
291 |
case 'k': |
277 |
case 'K': |
292 |
case 'K': |
278 |
retval |= set_umask (pp); |
293 |
retval |= set_umask (pp); |
Lines 328-334
Link Here
|
328 |
* Imposing a limit should be done with care, so a wrong |
343 |
* Imposing a limit should be done with care, so a wrong |
329 |
* entry means no care anyway :-). A '-' as a limits |
344 |
* entry means no care anyway :-). A '-' as a limits |
330 |
* strings means no limits --cristiang */ |
345 |
* strings means no limits --cristiang */ |
331 |
if (sscanf (buf, "%s%[ACDFMNRSTULPacdfmnrstulp0-9 \t-]", |
346 |
if (sscanf (buf, "%s%[ACDFMNRSTULPIOacdfmnrstulpio0-9 \t-]", |
332 |
name, tempbuf) == 2) { |
347 |
name, tempbuf) == 2) { |
333 |
if (strcmp (name, uname) == 0) { |
348 |
if (strcmp (name, uname) == 0) { |
334 |
strcpy (limits, tempbuf); |
349 |
strcpy (limits, tempbuf); |