Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 192526 | Differences between
and this patch

Collapse All | Expand All

(-)shadow-4.0.15/etc/limits (-1 / +3 lines)
Lines 18-27 Link Here
18
# T: max CPU time (MIN)
18
# T: max CPU time (MIN)
19
# U: max number of processes
19
# U: max number of processes
20
# L: max number of logins for this user
20
# L: max number of logins for this user
21
# I: max nice value (0..39 translates to 20..-19)
22
# O: max real time priority (0..MAX_RT_PRIO)
21
#
23
#
22
# Examples:
24
# Examples:
23
# the default entry
25
# the default entry
24
#* L2 D6144 R2048 S2048 U32 N32 F16384 T5 C0
26
#* L2 D6144 R2048 S2048 U32 N32 F16384 T5 C0 I20 O0
25
# another way of suspending a user login
27
# another way of suspending a user login
26
#guest   L0
28
#guest   L0
27
# this account has no limits
29
# this account has no limits
(-)shadow-4.0.15/libmisc/limits.c (-2 / +17 lines)
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);
(-)shadow-4.0.15/man/limits.5 (+6 lines)
Lines 67-72 Link Here
67
\(bu
67
\(bu
68
P: process priority, set by
68
P: process priority, set by
69
\fBsetpriority\fR(2).
69
\fBsetpriority\fR(2).
70
.TP 3
71
\(bu
72
I: max nice value (0..39 which translates to 20..-19)
73
.TP 3
74
\(bu
75
O: max real time priority
70
.PP
76
.PP
71
For example,
77
For example,
72
\fIL2D2048N5\fR
78
\fIL2D2048N5\fR

Return to bug 192526