Todd C. Miller
be4872f691
For sudoedit, run the editor with the user's original environment
...
as per the documentation (and as in sudo 1.7.x). Bug #688
2015-03-16 20:19:24 -06:00
Todd C. Miller
c3c28773f5
Sanity check the TZ environment variable by special casing it in
...
env_check. The --with-tzdir configure option can be used to
specify the zoneinfo directory if configure doesn't find it.
2015-02-06 11:01:05 -07:00
Todd C. Miller
a9bf105eda
Use stdint.h to get SIZE_MAX as inttypes.h on some pre-C99 HP-UX
...
systems doesn't include stdint.h itself.
2015-02-03 10:00:30 -07:00
Todd C. Miller
59ab26dbcc
Go back to a 2 args debug_decl and just use the "default" instance,
...
now renamed "active".
2015-02-01 08:24:49 -07:00
Todd C. Miller
e9914a91b1
The sudoers plugin now defines its own list of debugging subsystem names
...
and defines.
2014-10-22 13:30:52 -06:00
Todd C. Miller
866cfc4fc3
Add support for multiple Debug lines per program. Callers may
...
register arbitrary debug facilities or use built-in defaults. We
now use separate Debug statements for plugins and programs.
2014-10-22 13:23:05 -06:00
Todd C. Miller
7a901d4c07
Apple uses a different variant of the BASH_FUNC prefix for bash
...
functions.
2014-10-10 13:55:36 -06:00
Todd C. Miller
1890f0fcd6
Fix debugging printout output for env_should_keep()
2014-10-07 10:11:08 -06:00
Todd C. Miller
c823eb3ef9
Add BASH_FUNC_* to environment blacklist for newer-style bash functions.
2014-09-27 19:52:45 -06:00
Todd C. Miller
c49ca1d315
Don't allow pam_env to overwrite existing variables when env_reset
...
is disabled unless the variables match the black list and would
normally be removed. It may just be better to never overwrite when
env_reset is disabled.
2014-08-11 10:37:08 -06:00
Todd C. Miller
df0fd41530
Add explicit support for matching the full environment string
...
(name=value). Bash functions may now be preserved for full matches,
but not for name-only matches.
2014-08-06 16:45:57 -06:00
Todd C. Miller
36a5767e3e
efree -> sudo_efree for consistency
2014-07-10 15:35:04 -06:00
Todd C. Miller
2d61d38c23
Add sudo_ prefix to alloc.c functions and rename alloc.h -> sudo_alloc.h
2014-06-27 10:48:31 -06:00
Todd C. Miller
aecef4aa1d
Rename warning/fatal -> sudo_warn/sudo_fatal to avoid namespace
...
pollution in libsudo_util.so.
2014-06-27 09:30:52 -06:00
Todd C. Miller
b0f1fa7d05
Rename log_warning flags and only send mail if SLOG_SEND_MAIL is
...
set instead of mailing by default like we used to.
2014-05-02 20:54:01 -06:00
Todd C. Miller
954a3e77b1
Add log_warningx
2014-05-02 16:40:30 -06:00
Todd C. Miller
0a9a8d9562
Move SIZE_MAX compat define into missing.h where it belongs.
2014-05-01 08:38:43 -06:00
Todd C. Miller
5086194c67
Eliminate calls to fatal()/fatalx()/log_fatal() in env.c and just
...
pass back a return value.
2014-04-30 16:57:12 -06:00
Todd C. Miller
134b2a4228
Rename emalloc2() -> emallocarray() and erealloc3() -> ereallocarray().
2014-04-22 16:02:28 -06:00
Todd C. Miller
6a295400b7
Make "internal error, %s overflow" arguments consistent, using
...
__func__ where possible (when debugging is allowed).
2014-04-01 16:42:13 -06:00
Todd C. Miller
1017ad4e2c
Audit path too long errror. Add comments about non-audit events
...
and placeholders for future audit hooks.
2014-03-25 16:46:00 -06:00
Todd C. Miller
96eb2c4f8f
Add warning_gettext() wrapper function that changes to the user locale,
...
then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().
2013-11-18 08:59:57 -07:00
Todd C. Miller
f85106ea67
Use SLIST and STAILQ macros instead of doing headless singly linked
...
lists manually. As a bonus we now use a tail queue for ldap.c and
sudoreplay.c.
2013-10-22 09:08:09 -06:00
Todd C. Miller
7a76844d98
When merging the PAM environment, allow environment variables set
...
in PAM to override ones set by sudo as long as they do not match
the env_keep or env_check lists.
2013-08-17 06:34:09 -06:00
Todd C. Miller
85fc5792d4
Change some fatalx(NULL) that should be fatal(NULL).
2013-08-15 13:06:49 -06:00
Todd C. Miller
d6282d154a
Update copyright years.
2013-04-24 09:35:02 -04:00
Todd C. Miller
39acd2fcba
Rename error/errorx -> fatal/fatalx and remove the exit value as
...
it was always 1.
2013-04-18 14:07:59 -04:00
Todd C. Miller
7aae6bd6e3
Add line continuation support to sudo_parseln() and make it use
...
getline() instead of fgets() internally.
2013-02-07 10:56:01 -05:00
Todd C. Miller
1d7072fe09
Don't include <sys/param.h>. We only needed it for MAXPATHLEN,
...
MAXHOSTNAMELEN and the MIN/MAX macros. We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
2012-12-04 10:40:47 -05:00
Todd C. Miller
4bde57b8b2
Rename warning2()/error2() -> warning_nodebug()/error_nodebug().
2012-11-25 09:34:10 -05:00
Todd C. Miller
a0c53bd751
Call gettext inside log_error et al instead of having the caller do it. This way we can display any messages to the user in their own locale but log in the sudoers local.
2012-11-08 15:37:44 -05:00
Todd C. Miller
4207589fe2
Add simple locale switching to make it easy to switch from the
...
user's locale to the sudoers locale without making excessive
setlocale() calls when we don't need to.
2012-11-08 15:37:43 -05:00
Todd C. Miller
1d90c0ad71
No need to translate "unable to allocate memory" when we can just
...
use the system translation via strerror().
2012-09-17 16:59:26 -04:00
Todd C. Miller
faf112c53b
Replace the guts of sudo_setenv_nodebug() with our old setenv.c
...
which supports non-standard BSD and glibc semantics.
sudo_setenv() now simply calls sudo_setenv2().
2012-09-16 15:18:58 -04:00
Todd C. Miller
40d0492a42
Avoid setting LOGNAME, USER and USERNAME variables twice when
...
set_logname is enabled.
2012-09-11 10:24:20 -04:00
Todd C. Miller
6beab19148
Fix duplicate detection in sudo_putenv(), do not prune out the
...
variable we just set when overwriting an existing instance.
Fixes bug #570
2012-09-11 10:22:37 -04:00
Todd C. Miller
d2a46c0f81
Add some debuggging
2012-09-11 10:21:32 -04:00
Todd C. Miller
241b2395cf
Reduce the number of "internal error, foo overflow" messages that
...
need to be translated.
2012-08-10 12:18:38 -04:00
Todd C. Miller
7d255e42cb
Fix some warnings from clang checker-267
2012-08-07 11:01:28 -04:00
Todd C. Miller
e9f5a38398
Use MAX_UID_T_LEN + 1 for uid/gid buffers, not MAX_UID_T_LEN to
...
prevent potential truncation. Bug #562 .
2012-06-27 13:41:58 -04:00
Todd C. Miller
b78ca957a3
Fix signedness of didvar in env_update_didvar()
2012-03-28 13:39:37 -04:00
Todd C. Miller
cfdc45ea62
No need to preserve ODMDIR on AIX now that we always read
...
/etc/environment.
2012-03-28 08:18:26 -04:00
Todd C. Miller
caf01d98c4
When initializing the environment for env_reset, start out with
...
the contents of /etc/environment on AIX and login.conf on BSD.
2012-03-27 18:57:11 -04:00
Todd C. Miller
44ce5720de
Remove the NO_EXIT flag to log_error() and add a log_fatal() function
...
that exits and is marked no_return. Fixes false positives from
static analyzers and is easier for humans to read too.
2012-03-26 10:59:14 -04:00
Todd C. Miller
55d1a1a79d
Use ecalloc() when allocating structs.
2012-03-19 11:24:24 -04:00
Todd C. Miller
6d10909949
Pass a pointer to user_env in to the init_session policy plugin
...
function so session setup can modify the user environment as needed.
For PAM authentication, merge the PAM environment with the user
environment at init_session time. We no longer need to swap in the
user_env for environ during session init, nor do we need to disable
the env hooks at init_session time.
2012-03-15 09:18:36 -04:00
Todd C. Miller
19fc56462d
Add env_should_keep() and env_should_delete() wrapper functions to
...
simplify things a bit and hide the fact that matches_env_check()
is not bool.
2012-03-12 16:45:22 -04:00
Todd C. Miller
749784ea5b
matches_env_check() returns int, not boolean
2012-03-12 13:53:54 -04:00
Todd C. Miller
37770ecf1e
Initial cut at a hooks implementation. The plugin can register
...
hooks for getenv, putenv, setenv and unsetenv. This makes it
possible for the plugin to trap changes to the environment made by
authentication methods such as PAM or BSD auth so that such changes
are reflected in the environment passed back to sudo for execve().
2012-03-07 16:35:42 -05:00
Todd C. Miller
a24d86b32c
When running a login shell with a login_class specified, use
...
LOGIN_SETENV instead of rolling our own login.conf setenv support
since FreeBSD's login.conf has more than just setenv capabilities.
This requires us to swap the plugin-provided envp for the global
environ before calling setusercontext() and then stash the resulting
environ pointer back into the command details, which is kind of a
hack.
2011-12-08 17:17:25 -05:00