Todd C. Miller
2a2d2c4cd5
Add sudo Spanish translation from translationproject.org
2012-02-03 09:15:14 -05:00
Todd C. Miller
f5f9aadccc
Remove duplicate function prototypes
2012-02-02 11:28:19 -05:00
Todd C. Miller
ca4a338c45
Fix potential off-by-one when making a copy of the environment for
...
LD_PRELOAD insertion. Fixes bug #534
2012-01-30 13:49:24 -05:00
Todd C. Miller
f3f986c75d
regen
2012-01-29 14:48:20 -05:00
Todd C. Miller
1877c455d1
The change in 818e82ecbbfc that caused to exit when the monitor
...
dies created a race condition between the monitor exiting and the
status being read. All we really want to do is make sure that
select() notifies us that there is a status change when the monitor
dies unexpectedly so shutdown the socketpair connected to the monitor
for writing when it dies. That way we can still read the status
that is pending on the socket and select() on Linux will tell us
that the fd is ready.
2012-01-25 16:29:08 -05:00
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
66a66729af
When setting up the execution environment, set groups before gid/egid
...
like sudo 1.7 did.
2012-01-19 12:55:23 -05:00
Todd C. Miller
2fd77381a1
When not logging I/O, use a signal handler that only forwards SIGINT,
...
SIGQUIT and SIGHUP when they are user-generated signals. Fixes a
race in the non-I/O logging path where the command may receive two
keyboard-generated signals; one from the kernel and one from the
sudo process.
2012-01-17 10:27:33 -05:00
Todd C. Miller
97cecaf6eb
Back out change that put the command in its own pgrp when not logging
...
I/O. It causes problems with pipelines.
2012-01-17 10:25:44 -05:00
Todd C. Miller
ee0fb36d8b
regen dependencies
2012-01-13 06:02:17 -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
1c038be413
Add a check for devname() returning a fully-qualified pathname.
...
None of the devname() implementations do this today but you never
know when this might change.
2012-01-12 07:50:40 -05:00
Todd C. Miller
f05de3f3f1
The device name returned by devname() does not include the /dev/
...
prefix so we need to add it ourselves.
2012-01-11 15:38:18 -05:00
Todd C. Miller
f7b04c32ae
Add debug warning if KERN_PROC sysctl fails or devname() can't
...
resolve the tty device to a name.
2012-01-11 14:09:16 -05:00
Todd C. Miller
528258aff5
Add support for determining tty via sysctl on other BSD variants.
2012-01-10 16:49:24 -05:00
Todd C. Miller
832c4c9d57
For FreeBSD, try the KERN_PROC_PID sysctl() first, falling back on
...
ttyname() of std{in,out,err}.
2012-01-10 13:02:41 -05:00
Todd C. Miller
974e50dcf0
On newer FreeBSD we can get the parent's tty name via sysctl().
2012-01-09 16:08:58 -05:00
Todd C. Miller
c142a52f5b
Silence a gcc warning.
2012-01-09 15:33:51 -05:00
Todd C. Miller
0771c981de
Update copyright year.
2012-01-06 14:23:55 -05:00
Todd C. Miller
6021ad08cc
regen pot files
2012-01-06 13:49:16 -05:00
Todd C. Miller
72a4e0943e
Remove -D debug_level option.
2012-01-05 11:48:24 -05:00
Todd C. Miller
4da65677bd
When trying to determine the tty, fall back on /proc/ppid/fd/{0,1,2}
...
if the main process's fds 0-2 are not hooked up to a tty. Adapted
from a diff by Zdenek Behan.
2012-01-03 10:47:33 -05:00
Todd C. Miller
5bc0756406
When not logging I/O, put command in its own pgrp and make that the
...
controlling pgrp if the command is in the foreground. Fixes a race
in the non-I/O logging path where the command may receive two
keyboard-generated signals; one from the kernel and one from the
sudo process.
2012-01-03 10:06:07 -05:00
Todd C. Miller
7799d01cfa
Quiet a bogus gcc warning.
2011-12-20 13:50:48 -05:00
Todd C. Miller
089ee42228
Fix warnings related to sudo.conf accessors.
2011-12-20 13:39:19 -05:00
Todd C. Miller
1c3965f534
Separate sudo.conf parsing from plugin loading and move the parse
...
functions into the common lib so that visudo, etc. can use them.
2011-12-20 08:50:07 -05:00
Todd C. Miller
fb3c9f2ca5
Remove support for noexec_file in sudoers and the plugin API
2011-12-20 08:40:55 -05:00
Todd C. Miller
1f97735fbb
Fix typo in visiblepw description; from Joel Pickett
2011-12-18 14:20:56 -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
Todd C. Miller
98c77b5b96
Handle different Unix domain socket (actually socketpair) semantics
...
in BSD vs. Linux. In BSD if one end of the socketpair goes away
select() returns the fd as readable and the read will fail with
ECONNRESET. This doesn't appear to happen on Linux so if we notice
that the monitor process has died when I/O logging is enabled,
behave like the command has exited. This means we log the wait
status of the monitor, not the command, but there is nothing else
we can do at that point. This should only be an issue if SIGKILL
is sent to the monitor process.
2011-12-08 11:18:38 -05:00
Todd C. Miller
6bcf470fe9
Catch common signals in the monitor process so they get passed to
...
the command. Fixes a problem when the entire login session is
killed when ssh is disconnected or the terminal window is closed.
Previously, the monitor would exit and plugin's close method would
not be called.
2011-12-08 11:15:53 -05:00
Todd C. Miller
1cec1f4777
No need for install target to depend explicitly on install-dirs,
...
the install-foo targets all depend on it.
2011-12-07 14:33:25 -05:00
Todd C. Miller
9f0abb4692
Add support for setenv entries in login.conf. We can't use LOGIN_SETENV
...
since the plugin sets up the envp the command is executed with.
Also regen the Makefile.in files while here. Fixes bug #527
2011-12-05 10:43:44 -05:00
Todd C. Miller
38a4990e4a
Add getaddrinfo() for those without it, written by Russ Allbery
2011-12-02 17:28:50 -05:00
Todd C. Miller
0e26e43b99
Remove duplicate return statements.
2011-12-02 15:23:42 -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
51e45647ae
Use HAVE_STRUCT_TIMESPEC and HAVE_STRUCT_IN6_ADDR instead of
...
HAVE_TIMESPEC and HAVE_IN6_ADDR respectively.
2011-12-01 11:07:17 -05:00
Todd C. Miller
3f4b68dd18
No longer need to include time.h here as missing.h does not use
...
time_t.
2011-12-01 10:47:23 -05:00
Todd C. Miller
f7925b5889
Add Serbian translation for sudo from translationproject.org
2011-11-30 14:57:45 -05:00
Todd C. Miller
ab887a6fb0
No longer pass debug_file to plugin, plugins must now use CONV_DEBUG_MSG
2011-11-30 14:56:41 -05:00
Todd C. Miller
a64f1eaea8
Do not close error pipe or debug fd via closefrom() as we need them
...
to report an exec error should one occur.
2011-11-29 19:51:24 -05:00
Todd C. Miller
55166914c4
regen
2011-11-21 16:43:46 -05:00
Todd C. Miller
f689afb5ee
Fix non-dynamic (no dlopen) sudo build.
2011-11-13 21:24:54 -05:00
Todd C. Miller
65b781a2ef
Use SUDO_CONV_DEBUG_MSG in the plugin instead of writing
...
directly to the debug file.
2011-11-13 13:55:19 -05:00
Todd C. Miller
e58b232740
Change Debug sudo.conf setting to take a program name as the first
...
argument. In the future, this will allow visudo and sudoreplay to
use their own Debug entries.
2011-11-08 08:24:45 -05:00
Todd C. Miller
5d2c01e3d3
fix sudo_debug_printf priority
2011-11-08 08:22:48 -05:00
Todd C. Miller
3ee9cef0da
Fold SUDO_DEBUG_PROGERR and SUDO_DEBUG_SYSERR into SUDO_DEBUG_ERROR
2011-11-07 16:33:49 -05:00
Todd C. Miller
ab75dd2e30
Get rid of done: label. If the child exits we still need to close
...
the pty, update utmp and restore the SELinux tty context.
2011-10-24 11:14:20 -04: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
9923464d96
Wrap error/errorx and warning/warningx functions with debug statements.
...
Disable wrapping for standalone sudoers programs as well as memory
allocation functions (to avoid infinite recursion).
2011-10-22 14:28:33 -04:00