Todd C. Miller
0106343032
Use correct size for curlim and maxlim.
2020-09-03 10:20:28 -06:00
Todd C. Miller
c4a579cf8a
Pass resource limits values to the plugin in user_info[]
...
Sudo resets the resource limits early in its execution so
the plugin cannot tell what the original limits were itself.
2020-08-31 16:37:01 -06:00
Todd C. Miller
84e6e6ccf9
Update copyright year on some files where it was out of date.
2020-08-31 14:09:36 -06:00
Todd C. Miller
446ae3f507
Include string.h unconditionally and only use strings.h for strn?casecmp()
...
In the pre-POSIX days BSD had strings.h, not string.h.
Now strings.h is only used for non-ANSI string functions.
2020-05-18 07:59:24 -06:00
Todd C. Miller
dd88460800
We no longer need to include headers we don't use for sudo*.h files.
...
Previously we needed to include headers required by the various
sudo*h files. Now those files are more self-sufficient and we
should only include headers needed by code in the various .c files.
2020-05-18 06:47:04 -06:00
Todd C. Miller
712afe0319
Ignore a failure to restore the RLIMIT_CORE resource limit.
...
Linux containers don't allow RLIMIT_CORE to be set back to RLIM_INFINITY
if we set the limit to zero, even for root. This is not a problem
outside the container.
2020-03-14 11:13:55 -06:00
Todd C. Miller
1e25d03c98
Use 64-bit resource limits on AIX.
2019-12-25 16:39:11 -07:00
Todd C. Miller
dfabda3d49
When restoring old resource limits, try to recover if we receive
...
EINVAL. On NetBSD, setrlimit(2) can return EINVAL if the new soft
limit is lower than the current resource usage. This can be a
problem when restoring the old stack limit if sudo has raised it.
2019-12-25 13:48:04 -07:00
Todd C. Miller
dbc905fdf8
Sudo doesn't require such a large stack.
2019-12-25 13:13:20 -07:00
Todd C. Miller
486ee2b71f
debug_decl and debug_decl_vars now require a semicolon at the end.
2019-12-22 08:48:16 -07:00
Todd C. Miller
4392b5726e
Output the name of the limit when warning about setrlimit or getrlimit.
...
From Kimmo Suominen.
2019-12-18 09:42:14 -07:00
Todd C. Miller
9309ca0074
Simplify resource limit fallback logic a bit.
2019-11-12 07:26:14 -07:00
Todd C. Miller
f3ebe5025a
Don't set the RLIMIT_STACK soft/hard limits to unlimited.
...
Use 8Mb for soft and 64Mb for hard.
Works around issues on macOS and docker. See also Bug #908
2019-11-11 17:57:10 -07:00
Todd C. Miller
0d8062c100
macOS does not allow rlim_cur to be set to RLIM_INFINITY for RLIMIT_NOFILE.
...
We need to use OPEN_MAX instead as per the macOS setrlimit manual.
Bug #904
2019-10-29 08:28:52 -06:00
Todd C. Miller
5391ee2d5e
Not all systems support RLIMIT_NPROC and RLIMIT_RSS
2019-10-21 16:03:10 -06:00
Todd C. Miller
e80079eaa8
Set resource limits in the sudo process to unlimited.
...
We don't want sudo to be limited by the caller's resource limits.
The original resource limits are restore before session setup.
2019-10-21 11:41:48 -06:00