Commit Graph

59 Commits

Author SHA1 Message Date
Todd C. Miller
9c61d7e6e9 Bump the sudo plugin minor version.
The "update_ticket" entry was added to the settings list and the
"intercept_verify" entry was added to the command_info list.
2022-08-02 14:28:29 -06:00
Todd C. Miller
9ac42292d1 Bump plugin minor version and document new intercept-related settings.
There should have been a minor version bump for sudo 1.9.8 when
intercept was originally implemented.
2022-05-26 09:19:08 -06:00
Todd C. Miller
7c8746bc70 Document resource limit support in command_info[] and Bump plugin API minor.
This is supported beginning with sudo 1.9.9 and plugin API 1.17.
2021-11-09 12:57:25 -07:00
Todd C. Miller
fe9e65754c Add event_alloc to the audit plugin API.
The sudoers audit plugin will use this to communicate with sudo_logsrvd.
2020-11-02 15:28:21 -07: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
cef6e3687e Switch from memset_s() -> explicit_bzero().
memset_s() (and all of Annex K) is likely to be removed from the
a future version of the standard.
2020-08-10 19:24:32 -06:00
Todd C. Miller
f0dc48548c Add support for "accept" audit events sent by the sudo front-end.
With this change, the sudo front-end will send an "accept" audit
event to the audit plugins after all the I/O logging plugins have
been initialized.  This can be used by an audit plugin that does
not care about the result of the individual policy and approval
plugins and only wants to receive a single "accept" event if all
policy and approval plugins have succeeded.  The plugin_type argument
for events sent by the front-end is SUDO_FRONT_END (0).
2020-06-02 09:07:44 -06:00
Todd C. Miller
4e44bd46fe Disable -Wstrict-prototypes for sudo_hook_fn_t typedef. 2020-04-06 07:05:20 -06:00
Todd C. Miller
01a53f2865 Add open and close functions to the approval plugin API.
We need a close function to be able to to free memory allocated for
errstr.  Unlike the other plugins, the close function is called
immediately after the plugin's check or show_version function.
The plugin does not remain open until the command completes.
2020-02-10 15:29:48 -07:00
Todd C. Miller
db17cadaf6 Add an approval plugin type that runs after the policy plugin.
The basic idea is that the approval plugin adds an additional
layer of policy.  There can be multiple approval plugins.
2020-02-06 12:49:11 -07:00
Todd C. Miller
1b7dc82fee Change audit close arguments to a type and value.
That way we can distinguish between different error types.
2020-01-30 17:05:27 -07:00
Todd C. Miller
22105009d8 Define a new plugin type that receives accept and reject messages.
This can be used to implement logging-only plugins.
The plugin functions now take an errstr argument that can be used
to return an error string to be logged on failure or error.
2020-01-30 13:25:34 -07:00
Todd C. Miller
3a0445af9c Bump SUDO_CONV_REPL_MAX from 255 to 1023 2019-12-13 19:27:39 -07:00
Todd C. Miller
d0b80b404c Replace timeleft with pending in sudo plugin event API. 2019-12-07 08:42:10 -07:00
Todd C. Miller
5793023ffd Add a plugin interface to sudo main event loop. 2019-11-15 13:36:01 -07:00
Todd C. Miller
b02851dcf3 Change how the umask is handled with PAM and login.conf.
If the umask is explicitly set in sudoers, use that value regardless
of what is in PAM or login.conf.  If using the default umask from
sudoers, allow PAM or login.conf to override it.  Bug #900
2019-10-18 06:20:27 -06:00
Todd C. Miller
984382f8a9 Refer to number of terminal lines, not rows, for consistency. 2019-09-18 20:03:04 -06:00
Todd C. Miller
1e1ef61902 Add SPDX-License-Identifier to files. 2019-04-29 07:21:51 -06:00
Todd C. Miller
cf07dc0757 Add a suspend event type to the I/O log to log suspend/resume of
the command so we can skip that delay during replay.
2018-10-05 14:16:08 -06:00
Todd C. Miller
6eadaddc99 Add SUDO_CONV_PREFER_TTY flag for conversation function to tell
sudo to try writing to /dev/tty first.  Can be used in conjunction
with SUDO_CONV_INFO_MSG and SUDO_CONV_ERROR_MSG.
2018-06-13 11:19:33 -06:00
Todd C. Miller
dafb5f523a Fix typo. 2018-06-01 21:15:57 -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
8898ec1f9c Pass window size change events to the plugin. 2017-07-12 05:47:28 -06:00
Todd C. Miller
31540e6228 Bump version to 1.11 for timeout entry in settings[] 2017-02-16 10:28:08 -07:00
Todd C. Miller
541ffbeec8 Bump plugin minor version to 10 for sudo_mode, sudo_group and sudo_user. 2016-11-08 20:34:46 -07:00
Todd C. Miller
b20977d445 Add support for using fexecve() if supported on commands that are
checksummed.
2016-01-04 10:35:18 -07:00
Todd C. Miller
2c7ff33ea8 Explicitly mark large hex constants unsigned. 2015-09-24 11:23:02 -06:00
Todd C. Miller
edfeee6a7a No need to have version macros for hooks, callbacks and the sudoers
group plugin.  We can just use the main sudo API macros.  The sudoers
group plugin macros are preserved for source compatibility but are
not documented.
2015-09-09 14:56:52 -06:00
Todd C. Miller
98a15d9879 Add a struct sudo_conv_callback that contains on_suspend and on_resume
function pointer args plus a closure pointer and at it to the
conversation function.
2015-09-07 06:06:08 -06:00
Todd C. Miller
af47293800 Make hook_version and hook_type unsigned. 2015-09-02 08:00:27 -06:00
Todd C. Miller
3354d27a17 Do not follow symbolic links in sudoedit by default. This behavior
can be controlled by the sudoedit_follow Defaults flag as well as
the FOLLOW/NOFOLLOW tags.
2015-08-06 13:20:01 -06:00
Todd C. Miller
05a01d4c5d Avoid using a leading underbar in defines as they are reserved in
ISO C.
2015-05-21 11:13:20 -06:00
Todd C. Miller
346ff6766e Pass plugin path in the settings array. 2014-10-22 13:13:00 -06:00
Todd C. Miller
4913e02b40 SUDO_CONV_DEBUG_MSG is no longer supported. 2014-09-08 16:34:47 -06:00
Todd C. Miller
acdb6d3690 Change behavior when plugin I/O logging function returns 0 or -1.
For -1 (error) return, we now kill the command and disable
the I/O logging function that returned the error.
For a 0 (reject) return, we no longer display the rejected
output to the user's terminal.  The plugin API revision is now 1.6.
2014-08-26 12:07:57 -06:00
Todd C. Miller
1adeda54ef Add support for preventing fds from getting clobbered by closefrom(). 2013-12-20 11:14:32 -07:00
Todd C. Miller
1f3ea50afd Implement memset_s() and use it instead of zero_bytes().
A new constant, SUDO_CONV_REPL_MAX, is defined by the plugin
API as the max conversation reply length.  This constant can be
used as a max value for memset_s() when clearing passwords
filled in by the conversation function.
2013-08-03 08:30:06 -06:00
Todd C. Miller
c2860cce57 Overload -h option to specify an optional hostname for remote access.
This is future-proofing; no policy plugins currently support this.
2013-07-16 16:31:05 -06:00
Todd C. Miller
d6282d154a Update copyright years. 2013-04-24 09:35:02 -04:00
Todd C. Miller
855a11af2b Move signal code into its own source file and add sudo_sigaction()
wrapper that has an extra flag to check the saved_signals list to
only install the handler if the signal is not already ignored.
Bump plugin API version for the new front-end signal behavior.
2013-01-17 13:29:46 -05:00
Todd C. Miller
96f046c1ce Rename plugin "args" to "options" 2012-03-15 12:32:31 -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
7e11069932 Use sudo_hook_fn_t in struct sudo_hook. 2012-03-13 17:32:50 -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
a16dee915b Add support for plugin args at the end of a Plugin line in sudo.conf.
Bump the minor number accordingly and update the documentation.  A
plugin must check the sudo front end's version before using the
plugin_args parameter since it is only supported for API version
1.2 and higher.
2012-03-02 11:04:09 -05:00
Todd C. Miller
53e3ad11b5 New debug framework for sudo and plugins using /etc/sudo.conf that
also supports function call tracing.
2011-10-22 14:00:52 -04:00
Todd C. Miller
53da5e8cdf Update copyright years. 2011-03-11 15:34:35 -05:00
Todd C. Miller
e558b79e85 Move struct generic_plugin to sudo_plugin_int.h 2011-02-23 15:12:04 -05:00
Todd C. Miller
9948dae706 Change I/O log API to pass in command info to the I/O log open function.
Add iolog_file and iolog_dir parameters to command info.
This allows the policy plugin to specify the I/O log pathname.
Add convenience functions for calling plugin functions that
handle ABI backwards compatibility.
2010-12-20 16:20:11 -05:00
Todd C. Miller
e6b48d415c Replace built-in non-unix group support with a sudoers group plugin.
Include a sample plugin that can read Unix-format group files.
2010-07-02 11:11:25 -04:00