48 Commits

Author SHA1 Message Date
Todd C. Miller
e343e07543 Use #include <foo.h> instead of #include "foo.h" in most cases.
We rely on the include path to find many of these headers.  It
especially doesn't make sense to use #include "foo.h" for headers
in the top-level include directory.
2023-09-25 10:13:28 -06:00
Todd C. Miller
a9801cc99d Parse euid and egid from sudo front-end.
These are needed by bsm_audit.c.
2023-09-13 12:43:39 -06:00
Todd C. Miller
961a4afe67 Fix some warnings from pvs-studio 2020-08-12 13:45:09 -06:00
Todd C. Miller
15d93a1ca7 Fix Solaris and BSM audit warnings.
Use BSM audit on Illumos, which lacks Solaris audit.
2020-06-04 14:41:28 -06:00
Todd C. Miller
b519481912 Defer logging of the successful command until approval plugins have run.
This adds audit plugin support to the sudoers module, currently
only used for accept events.  As a result, the sudoers file is now
initially parsed as an audit plugin.
2020-06-02 09:07:46 -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
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
1e1ef61902 Add SPDX-License-Identifier to files. 2019-04-29 07:21:51 -06:00
Todd C. Miller
6c3d20cb41 Convert PVS-Studio comment to ANSI C. 2018-10-26 08:39:09 -06:00
Todd C. Miller
64e5d34c57 Add comments in .c files so PVS-Studio will check them. 2018-10-21 08:46:05 -06:00
Todd C. Miller
fdd7296122 Add a test for the 4-argument au_close() function found in Solaris
11 instead of assuming it is present if __sun is defined.  Fixes a
compilation error on OpenIndiana and older Solaris versions.
2018-08-27 13:50:23 -06:00
Todd C. Miller
dcf168e702 fix compiler warnings on Solaris 11 2018-08-22 10:40:11 -06:00
Todd C. Miller
48fba3c2cc update my email to Todd.Miller@sudo.ws 2017-12-03 17:53:40 -07:00
Todd C. Miller
b2770313c6 Only fall back to deprecated getaudit() on FreeBSD. Fixes compiler warnings on macOS. 2017-05-23 13:19:50 -06:00
Todd C. Miller
1298ea9107 Add target for "make splint". A few files need extra guards to avoid
errors on systems where they would not otherwise be compiled.
No warnings from splint.
2015-05-21 11:07:13 -06:00
Todd C. Miller
8930db0e09 Only fall back on AUE_DARWIN_sudo if au_preselect() fails. 2015-04-26 07:55:33 -06:00
Todd C. Miller
8a18383644 Work around a problem on Mac OS X 10.10 which defines AUE_sudo but
where au_preselect() only accepts AUE_DARWIN_sudo (the old value).
2015-04-25 19:44:52 -06: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
1ca52382a4 Fix compilation issues, fallout from the debug changes. 2014-10-23 09:26:13 -06: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
47835ff289 Rename missing.h -> sudo_compat.h 2014-07-22 14:25:16 -06:00
Todd C. Miller
127ba1354b Rename gettext.h -> sudo_gettext.h 2014-07-21 14:49:43 -06:00
Todd C. Miller
3687b665cb Rename fatal.h -> sudo_fatal.h 2014-07-21 14:40:18 -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
337a712745 Pass argc to audit functions too. Will be needed for Solaris audit
support.
2014-05-13 09:41:53 -06:00
Todd C. Miller
2220f55aef Propagate errors in audit code to caller instead of using fatal().
If we fail to audit an otherwise successful command, return an error
from the policy.  For Linux audit, sudo may be compiled with audit
support but auditing may not be setup, so we don't consider that
an error.
2014-03-26 13:00:56 -06:00
Todd C. Miller
12a1b672c0 We must include gettext.h before missing.h as it includes system
headers.  Also add missing DEFAULT_TEXT_DOMAIN defines in sudoers
audit code that does not include sudoers.h.
2014-02-11 09:40:59 -07: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
99352d6738 Rename error.h -> fatal.h now that there is no error() function. 2013-08-15 14:24:29 -06:00
Todd C. Miller
2f251caf47 Fix compilation on Solaris 11. 2013-08-15 10:39:40 -06:00
Todd C. Miller
251c79a77b Add missing missing.h 2013-08-15 10:08:27 -06:00
Todd C. Miller
d6282d154a Update copyright years. 2013-04-24 09:35:02 -04:00
Todd C. Miller
d913fe69c2 Change "foo: failed" to just "foo" since we print the string form
of errno.  Gets rids of some useless translations.
2013-04-19 09:55:48 -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
8d2c791806 Use same error message for getauid() failure. 2013-04-11 08:54:39 -04:00
Todd C. Miller
5ff23fb854 Use error() instead of log_fatal() 2012-03-28 13:47:49 -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
d5571aa1e0 Need to include gettext.h and sudo_debug.h; from John Hein 2012-01-09 12:36:43 -05:00
Todd C. Miller
839919566e Add debug_decl/debug_return (almost) everywhere.
Remove old sudo_debug() and convert users to sudo_debug_printf().
2011-10-22 14:40:21 -04:00
Todd C. Miller
b643b190a7 Prepare sudoers module messages for translation. 2011-05-16 16:32:05 -04:00
Todd C. Miller
53da5e8cdf Update copyright years. 2011-03-11 15:34:35 -05:00
Todd C. Miller
ae2f7638f5 standardize on "return foo;" rather than "return(foo);" or "return (foo);" 2011-01-24 15:15:18 -05:00
Todd C. Miller
77eb8cfe5b Use __sun for consistency with the rest of the sources. 2010-09-13 11:49:10 -04:00
Todd C. Miller
d9a3526320 Solaris BSM audit return EINVAL when auditing is not enabled, whereas
OpenBSM returns ENOSYS.
2010-09-08 09:47:00 -04:00
Todd C. Miller
2cd108304d Add Linux audit support. 2010-06-16 11:17:02 -04:00
Todd C. Miller
b72a530fd0 Update copyright year 2010-06-14 12:19:49 -04:00
Todd C. Miller
5475020561 Move audit sources into the sudoers plugin dir; the driver does not use them. 2010-04-30 15:38:33 -04:00