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.18.1/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.18.1/libmisc/limits.c (-2 / +17 lines)
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);
(-)shadow-4.0.18.1/man/limits.5 (+6 lines)
Lines 73-78 Link Here
73
\(bu
73
\(bu
74
P: process priority, set by
74
P: process priority, set by
75
\fBsetpriority\fR(2).
75
\fBsetpriority\fR(2).
76
.TP 3n
77
\(bu
78
I: max nice value (0..39 which translates to 20..-19)
79
.TP 3n
80
\(bu
81
O: max real time priority
76
.sp
82
.sp
77
.RE
83
.RE
78
.PP
84
.PP

Return to bug 192526