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