Todd C. Miller
d11e7febbc
Refactor disable_execute() and my_execve() into exec_common.c for
...
use by sesh.c. This fixes NOEXEC when SELinux is used. Instead
of disabling exec in exec_setup(), disable it immediately before
executing the command. Adapted from a diff by Arno Schuring.
2012-01-25 14:58:02 -05:00
Todd C. Miller
106bbebba7
Move tty name lookup code to its own file.
2012-01-13 06:01:58 -05:00
Todd C. Miller
0771c981de
Update copyright year.
2012-01-06 14:23:55 -05:00
Todd C. Miller
72a4e0943e
Remove -D debug_level option.
2012-01-05 11:48:24 -05:00
Todd C. Miller
089ee42228
Fix warnings related to sudo.conf accessors.
2011-12-20 13:39:19 -05:00
Todd C. Miller
21a2f95821
Use stdbool.h instead of rolling our own TRUE/FALSE macros.
2011-12-02 11:27:33 -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
47af0fc2b8
Add configure test for missing errno declaration and only
...
declare it ourselves if it is missing.
2011-08-30 10:05:30 -04:00
Todd C. Miller
022591f4bf
Add a wrapper for setgroups() that trims off extra groups and retries
...
if setgroups() fails. Also add some missing addrefs for PERM_USER
and PERM_FULL_USER.
2011-07-20 16:54:12 -04:00
Todd C. Miller
bf7e7b5752
Add gettext.h convenience header. This is similar to but distinct from
...
the one included with the gettext package.
2011-05-20 11:48:17 -04:00
Todd C. Miller
15bc74bd67
Include libint.h where needed.
2011-05-16 16:37:11 -04:00
Todd C. Miller
3506f01077
Add support for controlling whether utmp is updated and which user is
...
listed in the entry.
2011-03-15 15:53:49 -04:00
Todd C. Miller
53da5e8cdf
Update copyright years.
2011-03-11 15:34:35 -05:00
Todd C. Miller
7debf44742
Move noexec path into sudo.conf now that sudo itself handles noexec.
...
Currently can be configured in sudoers too but is now undocumented
and will be removed in a future release.
2011-03-10 16:12:33 -05:00
Todd C. Miller
a092d2fdcf
Move noexec handling to sudo front-end where it is documented as being.
2011-03-10 15:11:49 -05:00
Todd C. Miller
c7a7d31905
Add support for disabling exec via solaris privileges.
...
Includes preparation for moving noexec support out of sudoers
and into front end as documented.
2011-03-10 14:24:10 -05:00
Todd C. Miller
59515a4a6d
add help text to sudo, visudo and sudoreplay for the -h option
2011-02-21 11:33:36 -05:00
Todd C. Miller
c18468d1a5
Save signal state before changing handlers and restore before
...
we execute the command.
2011-02-02 12:44:35 -05:00
Todd C. Miller
5966b67dda
Don't need iolog variables in struct command_details, they are for
...
the I/O log plugins to handle.
2010-12-28 10:50:45 -05:00
Todd C. Miller
c833ff02b6
Add use_pty command_info flag for policies to indicate that a
...
pty should be allocated even if no I/O logging is performed.
2010-12-20 16:27:46 -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
e2f253e51d
Fix TCGETWINSZ compat.
2010-10-07 14:11:10 -04:00
Todd C. Miller
1009d7a3e6
Query local network interfaces in the main sudo driver and pass to
...
the plugin as "network_addrs" in the settings list.
2010-09-08 14:20:11 -04:00
Todd C. Miller
10c3bb62c4
Make local includes consistent; use double quotes for local includes
...
except for generated ones where we use angle brackets.
Also g/c unused compat.h.
2010-09-07 16:45:19 -04:00
Todd C. Miller
f454727bb8
Merge compat.h and missing.h into missing.h
2010-08-16 14:05:44 -04:00
Todd C. Miller
6bcd9efc0c
Use gettimeofday() directly instead of via the gettime() wrapper.
2010-08-10 13:50:40 -04:00
Todd C. Miller
30fe4a067c
Set usrinfo for AIX
...
Set adminstrative domain for the process when looking up user's
password or group info and when preparing for execve().
Include strings.h even if string.h exists since they may define
different things. Fixes warnings on AIX and others.
2010-06-29 13:08:05 -04:00
Todd C. Miller
d018936b4e
Move functions and symbols shared between exec.c and exec_pty.c
...
into sudo_exec.h.
2010-06-16 16:46:56 -04:00
Todd C. Miller
4fb8a83e6f
Fix -A flag when askpass is specified in sudo.conf or if sudo doesn't need
...
to read a password.
2010-06-15 15:11:10 -04:00
Todd C. Miller
f64bb67c6c
Clean up some XXXs
2010-06-15 15:01:11 -04:00
Todd C. Miller
b72a530fd0
Update copyright year
2010-06-14 12:19:49 -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
34613c8465
Use a flag bit in struct command_details for selinux instead of a separate
...
field.
2010-06-09 16:25:44 -04:00
Todd C. Miller
4c1ef12648
Implement background mode. If I/O logging we use pipes instead of a pty.
2010-06-09 16:19:45 -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
edd34a2d7e
Add selinux_enabled flag into struct command_details and
...
set it in command_info_to_details().
Return an error from selinux_setup() instead of exiting.
Call selinux_setup() from exec_setup().
2010-06-08 17:59:18 -04:00
Todd C. Miller
6717c59d77
Split exec.c into exec.c and exec_pty.c
2010-06-07 18:06:22 -04:00
Todd C. Miller
9773ba3f79
Rename script_execve to sudo_execve and rename script_foo in exec.c
2010-05-27 16:46:31 -04:00
Todd C. Miller
f8f82ffa8e
Rename script_setup() to pty_setup() and call from script_execve()
...
directly.
2010-05-27 16:29:48 -04:00
Todd C. Miller
2942edcbd0
Rework SELinux support.
2010-05-25 11:00:39 -04:00
Todd C. Miller
5f857e6e54
Make SELinux support compile again. Needs more work to be complete.
2010-05-24 18:18:50 -04:00
Todd C. Miller
0487aee6b4
Bring back closefrom settings.
2010-05-24 15:40:36 -04:00
Todd C. Miller
064cffd575
Cosmetic changes:
...
add comments, remove orphaned prototype and make a global static.
2010-05-21 12:01:11 -04:00
Todd C. Miller
3ac9aee52e
If plugin sets "sudoedit=true" in the command info, enable
...
sudoedit mode even if not invoked as sudoedit. This allows
a plugin to enable sudoedit when the user runs an editor.
2010-05-16 19:27:04 -04:00
Todd C. Miller
7c9c5855fd
Change how we handle the sudoedit argv. We now require that there
...
be a "--" in argv to separate the editor and any command line arguments
from the files to be edited.
2010-05-13 17:11:31 -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
c2d0888bf9
No need to use pseudo-cbreak mode now that we use pipes when stdout is
...
not a tty. Instead, check whether stdin is a tty and if not, delay
setting the tty to raw mode until the command tries to access it itself
(and receives SIGTTIN or SIGTTOU).
2010-05-10 17:23:35 -04:00
Todd C. Miller
0eda64b235
Do not need the opost flag to term_copy() now that we use pipes for
...
stdout/stderr when they are not a tty.
2010-05-03 10:41:26 -04:00
Todd C. Miller
4b04e875ed
Move fileops.c defines and prototypes to filesops.h
2010-04-23 06:02:39 -04:00
Todd C. Miller
6b180d24da
Fix the -s and -i flags and add support for the "implied_shell"
...
option. If the user does not specify a command, sudo will now pass
in the path to the user's shell and set impied_shell=true. The
plugin can them either check the command normally or return -2 to
cause sudo to print a usage message and exit.
2010-03-21 08:54:06 -04:00