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
Todd C. Miller
e146aaaa29
Fix visiblepw sudoers option; the plugin API portion still needs documenting
2010-06-10 15:02:32 -04:00
Todd C. Miller
a4a6620b24
Add SUDO_CONV_PROMPT_MASK define which corresponds to the "pwfeedback"
...
sudoers option. Do not disable echo if TGP_ECHO is set.
2010-06-09 10:31:05 -04:00
Todd C. Miller
7e6d1d1f7d
Add init_session function to struct policy_plugin that gets called
...
before the uid/gid/etc changes. A struct passwd pointer is passed in,which may be NULL if the user does not exist in the passwd database.The sudoers module uses init_session to open the pam session as needed.
2010-05-27 14:46:39 -04:00
Todd C. Miller
55ef027d88
Add argc and argv to I/O logger open function.
2010-05-17 10:38:56 -04:00
Todd C. Miller
fa717176b2
Remove check_sudoedit function pointer in struct sudo_policy.
...
Instead, sudo will set sudoedit=true in the settings array.
The plugin should check for this and modify argv_out as appropriate
in check_policy.
2010-05-17 10:25:27 -04:00
Todd C. Miller
fdd28d411f
Work in progress support for sudoedit. The actual interface used by the
...
plugin for sudoedit is likely to change.
2010-05-13 14:09:21 -04:00
Todd C. Miller
782f494003
Add separate I/O logging functions for tty in/out and stdin/stdout/stderr.
...
NOTE: stdin logging does not currently work and is disabled for now.
2010-05-05 07:29:28 -04:00
Todd C. Miller
9fbec34fed
Add pointer to a printf like function to plugin open functon.
...
This can be used instead of the conversation function to display
info and error messages.
2010-05-04 19:17:31 -04:00
Todd C. Miller
90c06ad7f2
Sudo plugin API
2010-02-20 09:30:27 -05:00