Todd C. Miller [Sat, 19 Jan 2013 20:10:01 +0000 (15:10 -0500)]
Remove extra flag to sudo_sigaction(). We want to trap the signal
regardless of whether or not it is ignored by the underlying command
since there's no way to know what signal handlers the command will
install. Now we just use sudo_sigaction() to set a flag in
saved_signals[] to indicate whether a signal needs to be restored
before exec.
Todd C. Miller [Fri, 18 Jan 2013 19:58:12 +0000 (14:58 -0500)]
Use _getgroupsbymember() on Solaris to get the groups list. Fixes
performance problems with the getgroupslist() compat on Solaris
systems with network-based group databases.
Todd C. Miller [Thu, 17 Jan 2013 20:13:32 +0000 (15:13 -0500)]
Document signal handler behavior in plugin API 1.3
Todd C. Miller [Thu, 17 Jan 2013 18:29:46 +0000 (13:29 -0500)]
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.
Todd C. Miller [Thu, 17 Jan 2013 14:20:45 +0000 (09:20 -0500)]
Catch SIGINT, SIGQUIT and SIGTSTP in the front end before we execute
the command. If we get SIGINT or SIGQUIT, call the plugin close()
functions as if the command was interrupted. If we get SIGTSTP,
uninstall the handler and deliver SIGTSTP to ourselves.
Todd C. Miller [Thu, 17 Jan 2013 14:17:54 +0000 (09:17 -0500)]
Rename handle_signals() to dispatch_signals().
Block other signals in handler() so we don't have to worry about
the write() being interrupted.
Todd C. Miller [Wed, 16 Jan 2013 20:28:36 +0000 (15:28 -0500)]
Rename signal handler to avoid name clash with one in exec.c
Todd C. Miller [Sun, 13 Jan 2013 20:24:12 +0000 (15:24 -0500)]
Add missing call to save_signals().
Todd C. Miller [Fri, 11 Jan 2013 22:08:49 +0000 (17:08 -0500)]
Fill in the comment block at the top of the .pot files and preserve
it when regenerating them.
Todd C. Miller [Fri, 11 Jan 2013 19:34:09 +0000 (14:34 -0500)]
Add exec_background option in plugin command info and a sudoers
option to match. When set, commands are started in the background
and automatically foregrounded as needed. There are issues with
some ill-mannered programs (like Linux su) so this is not the
default.
Todd C. Miller [Fri, 11 Jan 2013 19:29:37 +0000 (14:29 -0500)]
regen
Todd C. Miller [Fri, 11 Jan 2013 19:28:52 +0000 (14:28 -0500)]
Add SESH_OBJS variable for sesh object files.
Todd C. Miller [Fri, 11 Jan 2013 19:14:10 +0000 (14:14 -0500)]
Update copyright year.
Todd C. Miller [Fri, 11 Jan 2013 15:09:06 +0000 (10:09 -0500)]
Always resume the command in the foreground if sudo itself is the
foreground process. This helps work around poorly behaved programs
that catch SIGTTOU/SIGTTIN but suspend themselves with SIGSTOP. At
worst, sudo will go into the background but upon resume the command
will be runnable. Otherwise, we can get into a situation where the
command will immediately suspend itself.
Todd C. Miller [Fri, 11 Jan 2013 14:39:59 +0000 (09:39 -0500)]
Use -fstack-protector-all in preference to -fstack-protector
where supported.
Todd C. Miller [Fri, 11 Jan 2013 02:27:40 +0000 (21:27 -0500)]
Only test for -fstack-protector and -fvisibility=hidden on GNU
compatible compilers.
Todd C. Miller [Thu, 3 Jan 2013 19:52:10 +0000 (14:52 -0500)]
Add Sudo 1.8.6p4
Todd C. Miller [Thu, 3 Jan 2013 19:20:49 +0000 (14:20 -0500)]
Break out stack smashing protector options into SSP_CFLAGS and
SSP_LDFLAGS so we can use it everywhere (unlike LT_LDFLAGS).
Todd C. Miller [Tue, 1 Jan 2013 18:31:40 +0000 (13:31 -0500)]
In rbrepair(), make sure we never try to change the color of the
sentinel node, which is the first entry, not the root.
From Michael King
Todd C. Miller [Fri, 28 Dec 2012 16:03:23 +0000 (11:03 -0500)]
No need to restore default signal handler for SIGSTOP as it is not
catchable. Attempting to do so is harmless but sigaction() will
fail and set errno to EINVAL which makes it looks like there is an
error.
Todd C. Miller [Fri, 28 Dec 2012 16:01:36 +0000 (11:01 -0500)]
Print SIGCONT_FG and SIGCONT_BG properly in debug output.
Todd C. Miller [Thu, 27 Dec 2012 21:25:51 +0000 (16:25 -0500)]
Disable PIE on FreeBSD/ia64, otherwise sudo will segfault.
Todd C. Miller [Thu, 20 Dec 2012 19:46:45 +0000 (14:46 -0500)]
Add howmany() macro since some systems have this in sys/param.h
which we no longer include.
Todd C. Miller [Fri, 7 Dec 2012 19:58:06 +0000 (14:58 -0500)]
Remove errant file.
Todd C. Miller [Tue, 4 Dec 2012 15:41:59 +0000 (10:41 -0500)]
Remove obsolete sudoers_cleanup() stubs.
Todd C. Miller [Tue, 4 Dec 2012 15:40:47 +0000 (10:40 -0500)]
Don't include <sys/param.h>. We only needed it for MAXPATHLEN,
MAXHOSTNAMELEN and the MIN/MAX macros. We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
Todd C. Miller [Tue, 4 Dec 2012 15:18:41 +0000 (10:18 -0500)]
Use MAX_HOST_NAME+1 (limits.h) instead of MAXHOSTNAMELEN (sys/param.h
or netdb.h).
Todd C. Miller [Fri, 30 Nov 2012 16:39:27 +0000 (11:39 -0500)]
Move debug_decl() in log_failure() to be after the variable
declarations for C89.
Todd C. Miller [Thu, 29 Nov 2012 11:37:13 +0000 (06:37 -0500)]
Cannot wrap sigsetjmp() or we end up returning to the wrong place.
Use a macro instead.
Todd C. Miller [Wed, 28 Nov 2012 21:48:04 +0000 (16:48 -0500)]
Fix return in sudoers_policy_open that should be debug_return.
Todd C. Miller [Tue, 27 Nov 2012 15:49:46 +0000 (10:49 -0500)]
Define sudo_ttyname_dev() for the HAVE_STRUCT_PSINFO_PR_TTYDEV case
too.
Todd C. Miller [Tue, 27 Nov 2012 15:29:55 +0000 (10:29 -0500)]
Quiet a gcc warning and add comment about needing to keep the
handle open.
Todd C. Miller [Mon, 26 Nov 2012 20:25:19 +0000 (15:25 -0500)]
mention --disable-shared
Todd C. Miller [Mon, 26 Nov 2012 14:57:35 +0000 (09:57 -0500)]
Add missing command_info argument in I/O plugin open() prototype.
Bug #579
Todd C. Miller [Sun, 25 Nov 2012 16:55:33 +0000 (11:55 -0500)]
Regen for proper line numbers.
Todd C. Miller [Sun, 25 Nov 2012 16:54:17 +0000 (11:54 -0500)]
Add locale_stub.o to SUDO_OBJS, not locale_stub.lo.
Todd C. Miller [Sun, 25 Nov 2012 16:51:43 +0000 (11:51 -0500)]
Include missing.h for __printflike.
Todd C. Miller [Sun, 25 Nov 2012 14:46:40 +0000 (09:46 -0500)]
Saner loop invariant in io_mkdirs (cosmetic only).
Todd C. Miller [Sun, 25 Nov 2012 14:34:40 +0000 (09:34 -0500)]
Move warn/error into common and make static builds work.
Todd C. Miller [Sun, 25 Nov 2012 14:34:33 +0000 (09:34 -0500)]
Move _sudo_printf from src/conversation.c to common/sudo_printf.c.
Add sudo_printf function pointer that is initialized to _sudo_printf()
instead of requiring a sudo_conv function pointer everywhere. The
plugin will reset sudo_printf to point to the version passed in via
the plugin open function. Now plugin_error.c can just call sudo_printf
in all cases. The sudoers binaries no longer need their own version
of sudo_printf.
Todd C. Miller [Sun, 25 Nov 2012 14:34:26 +0000 (09:34 -0500)]
Add plugin_setjmp() wrapper for siglongjmp(error_jmp, 1) so we don't
need error_jmp to be extern. Also add plugin_clearjmp() that clears
a flag so error()/errorx() knows when to call exit() vs. longjmp().
Todd C. Miller [Sun, 25 Nov 2012 14:34:20 +0000 (09:34 -0500)]
Let warning() call gettext() for us.
Todd C. Miller [Sun, 25 Nov 2012 14:34:15 +0000 (09:34 -0500)]
Do locale swapping in the warning()/error() macros themselves instead
of in the underlying functions.
Todd C. Miller [Sun, 25 Nov 2012 14:34:10 +0000 (09:34 -0500)]
Rename warning2()/error2() -> warning_nodebug()/error_nodebug().
Todd C. Miller [Sun, 25 Nov 2012 14:34:04 +0000 (09:34 -0500)]
Call gettext() on parameters for warning()/warningx() instead of
having warning() do it for us.
Todd C. Miller [Sun, 25 Nov 2012 14:33:58 +0000 (09:33 -0500)]
Call gettext() in sudoerserror() in the user's locale and pass the untranslated string to it.
Todd C. Miller [Sun, 25 Nov 2012 14:33:52 +0000 (09:33 -0500)]
Allow sudoers programs (visudo, sudoreplay, visudo) to use
plugin_error.c instead of the error.c from the front-end. This
means sudoers_setlocale() needs to be independent of the sudo_user
struct and the defaults table. The sudoers locale is now updated
via a callback.
Todd C. Miller [Sun, 25 Nov 2012 14:33:33 +0000 (09:33 -0500)]
Include setjmp.h in sudoers.h
Move error_jmp into plugin_error.c
Rename sudoers_plugin_cleanup sudoers_cleanup
Make sudoers warning/error functions work when sudo_conv is NULL
Todd C. Miller [Sun, 25 Nov 2012 14:25:15 +0000 (09:25 -0500)]
No need to change locale in front-end warning()/error().
Todd C. Miller [Sun, 25 Nov 2012 14:23:17 +0000 (09:23 -0500)]
Ignore bad lines in passwd/group file instead if stopping processing when we hit one.
Todd C. Miller [Sun, 25 Nov 2012 13:12:55 +0000 (08:12 -0500)]
Bash doesn't let you set UID to use MYUID instead.
Todd C. Miller [Sun, 25 Nov 2012 13:12:54 +0000 (08:12 -0500)]
Avoid NULL deref for unknown Defaults in strict mode.
Todd C. Miller [Sun, 25 Nov 2012 13:10:12 +0000 (08:10 -0500)]
See DEFAULT_TEXT_DOMAIN
Todd C. Miller [Tue, 13 Nov 2012 14:46:19 +0000 (09:46 -0500)]
Add signame.c and mksigname.
Todd C. Miller [Tue, 13 Nov 2012 14:41:52 +0000 (09:41 -0500)]
Fold preinstall into install-plugin and pass the path to the
plugin binary to the preinstall command.
Todd C. Miller [Tue, 13 Nov 2012 13:54:40 +0000 (08:54 -0500)]
sync with upstream
Todd C. Miller [Tue, 13 Nov 2012 13:54:31 +0000 (08:54 -0500)]
repair spacing
Todd C. Miller [Mon, 12 Nov 2012 22:12:34 +0000 (17:12 -0500)]
Set group on sudo_debug when creating it to gid 0 so systems without
BSD group semantics don't get the invoking user's group.
Todd C. Miller [Mon, 12 Nov 2012 22:04:24 +0000 (17:04 -0500)]
Rename mkdir_parents() io_mkdirs() and add a flag to specify whether
path is a temporary, in which case the final component is created
via mkdtemp() instead of mkdir().
Todd C. Miller [Mon, 12 Nov 2012 20:20:10 +0000 (15:20 -0500)]
For PERM_ROOT set egid to 0 so log files are not created with
the gid of the user.
Todd C. Miller [Mon, 12 Nov 2012 14:41:56 +0000 (09:41 -0500)]
Add calls to set_perms(PERM_ROOT) becore logging to a file. We
should already be root but since we cache the current permission
status it is basically free. That way, if more of sudoers runs as
non-root in the future logging will still work correctly.
Todd C. Miller [Mon, 12 Nov 2012 13:51:58 +0000 (08:51 -0500)]
#unifdef HAVE_SETLOCALE, it is C89 so no need to check for it.
Todd C. Miller [Mon, 12 Nov 2012 11:27:53 +0000 (06:27 -0500)]
Mention that sudo.conf is parsed in the C locale.
Todd C. Miller [Mon, 12 Nov 2012 10:42:48 +0000 (05:42 -0500)]
Parse sudo.conf in the "C" locale.
Todd C. Miller [Mon, 12 Nov 2012 10:36:43 +0000 (05:36 -0500)]
Fix compilation on systems w/o setlocale()
Todd C. Miller [Mon, 12 Nov 2012 10:22:01 +0000 (05:22 -0500)]
Sudo now includes a workaround for the Solaris 11 locale issue.
Todd C. Miller [Mon, 12 Nov 2012 01:23:53 +0000 (20:23 -0500)]
Always include locale.h from gettext.h so we no longer need to
include locale.h from the .c files.
Todd C. Miller [Sun, 11 Nov 2012 12:11:22 +0000 (07:11 -0500)]
Add os-specific initialization functions for solaris (workaround
setuid locale problem in Solaris 11) and openbsd (set malloc_options
if SUDO_DEVEL). Also move set_project() to solaris.c.
Todd C. Miller [Fri, 9 Nov 2012 21:32:29 +0000 (16:32 -0500)]
Avoid strerror() when possible and just rely on warning/error
to handle errno in the proper locale.
Todd C. Miller [Fri, 9 Nov 2012 21:31:23 +0000 (16:31 -0500)]
Set sudoers locale in log_allowed()
Todd C. Miller [Fri, 9 Nov 2012 20:37:03 +0000 (15:37 -0500)]
Make the sudo lecture translatable.
Todd C. Miller [Fri, 9 Nov 2012 20:31:04 +0000 (15:31 -0500)]
Add the values of badpass_message, passprompt and mailsub to
sudoers.pot so they can be translated.
Todd C. Miller [Fri, 9 Nov 2012 20:30:06 +0000 (15:30 -0500)]
Expand the FMT_FIRST anf FMT_CONTD macros inline so they get picked
up by xgettext.
Todd C. Miller [Thu, 8 Nov 2012 21:40:37 +0000 (16:40 -0500)]
Make expand_prompt() args const and free the prompt when we are
done with it.
Todd C. Miller [Thu, 8 Nov 2012 21:40:03 +0000 (16:40 -0500)]
Fix cut and pasto
Todd C. Miller [Thu, 8 Nov 2012 21:39:44 +0000 (16:39 -0500)]
Expand def_mailsub in the sudoers locale, not the user's.
Todd C. Miller [Thu, 8 Nov 2012 20:37:44 +0000 (15:37 -0500)]
Call gettext inside log_error et al instead of having the caller do it. This way we can display any messages to the user in their own locale but log in the sudoers local.
Todd C. Miller [Thu, 8 Nov 2012 20:37:44 +0000 (15:37 -0500)]
Display warning/error messages in the user's locale.
Todd C. Miller [Thu, 8 Nov 2012 20:37:43 +0000 (15:37 -0500)]
audit_failure() now calls gettext itself using the sudoers locale.
Todd C. Miller [Thu, 8 Nov 2012 20:37:43 +0000 (15:37 -0500)]
Convert setlocale() to sudoers_setlocale() in the sudoers module.
This only converts existing uses, there are more places where we
need to sprinkle sudoers_setlocale() calls.
Todd C. Miller [Thu, 8 Nov 2012 20:37:43 +0000 (15:37 -0500)]
Add simple locale switching to make it easy to switch from the
user's locale to the sudoers locale without making excessive
setlocale() calls when we don't need to.
Todd C. Miller [Thu, 8 Nov 2012 20:37:42 +0000 (15:37 -0500)]
Add variants of warn/error and sudo_debug_printf that take a va_list
instead of a variable number of args.
Todd C. Miller [Thu, 8 Nov 2012 20:22:44 +0000 (15:22 -0500)]
Document Solaris 11 locale issues and workarounds.
Todd C. Miller [Thu, 8 Nov 2012 19:45:22 +0000 (14:45 -0500)]
Solaris gettext() looks in lang.UTF-8, not just lang for UTF-8 locales.
Make links from localdir/lang -> localdir/lang.UTF-8
Todd C. Miller [Tue, 6 Nov 2012 16:19:51 +0000 (11:19 -0500)]
Do not inform the user that the command was not permitted by the
policy if they do not successfully authenticate. This is a regression
introduced in sudo 1.8.6.
Todd C. Miller [Tue, 6 Nov 2012 16:08:53 +0000 (11:08 -0500)]
Add preinstall target that runs SUDO_PREINSTALL_CMD. Used to fixup
the rpath in HP-UX SOM shared libraries for the LDAP libs.
Todd C. Miller [Tue, 6 Nov 2012 16:00:22 +0000 (11:00 -0500)]
The -a option should be #ifdef HAVE_BSD_AUTH_H, not -A.
Todd C. Miller [Sun, 28 Oct 2012 16:58:48 +0000 (12:58 -0400)]
Allow the user to specify and alternate libtool
Todd C. Miller [Fri, 26 Oct 2012 14:27:56 +0000 (10:27 -0400)]
Allow sudo to be build with sss support without also including ldap
support. From Stephane Graber.
Todd C. Miller [Thu, 25 Oct 2012 20:58:31 +0000 (16:58 -0400)]
Refactor policy plugin interface code from sudoers.c into policy.c
Todd C. Miller [Thu, 25 Oct 2012 17:16:58 +0000 (13:16 -0400)]
Refactor command_info setting into its own function.
Todd C. Miller [Thu, 25 Oct 2012 17:15:52 +0000 (13:15 -0400)]
Make interfaces pointer private to interfaces.c and add get_interfaces()
accessor.
Todd C. Miller [Wed, 24 Oct 2012 20:32:43 +0000 (16:32 -0400)]
Make user_cwd const since it is either a string literal or passed
in from the front-end.
Todd C. Miller [Wed, 24 Oct 2012 20:29:13 +0000 (16:29 -0400)]
sudo 1.8.7
Todd C. Miller [Wed, 24 Oct 2012 18:24:36 +0000 (14:24 -0400)]
Avoid nested strtok() calls.
Todd C. Miller [Tue, 23 Oct 2012 18:27:52 +0000 (14:27 -0400)]
Move expand_prompt() into its own source file for easier unit testing.
Todd C. Miller [Tue, 23 Oct 2012 18:16:57 +0000 (14:16 -0400)]
Make check.c independent of the underlying timestamp implementation.
Todd C. Miller [Tue, 23 Oct 2012 15:57:07 +0000 (11:57 -0400)]
Add SUDOERS_NO_SEQ define to allow ${seq} to be disabled.
Todd C. Miller [Tue, 23 Oct 2012 14:21:24 +0000 (10:21 -0400)]
Use a list for the possible values of Tag_Spec with a minimal indent
to improve readability. In the pod version, these were =head3.
Also use .St -p1003.1 instead of just POSIX when talking about
glob() and fnmatch().
Todd C. Miller [Tue, 2 Oct 2012 19:29:52 +0000 (15:29 -0400)]
sudo_ttyname_dev() is unused if there is no /proc or sysctl().