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: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 [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 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 [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 [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: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 [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, 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, 25 Sep 2012 17:49:51 +0000 (13:49 -0400)]
Start commands in the background when I/O logging is enabled. We
can't do this on Mac OS X due to a kernel bug in tc[gs]etattr(2)
which returns EINTR on signal instead of restarting automatically.
Todd C. Miller [Mon, 24 Sep 2012 19:06:14 +0000 (15:06 -0400)]
Fix running commands that need the terminal in the background when
I/O logging is enabled. E.g. "sudo vi &". When the command is
foregrounded, it will now resume properly.
Todd C. Miller [Fri, 21 Sep 2012 20:25:01 +0000 (16:25 -0400)]
Split out implementation-specific back end code out of pwutil.c
into pwutil_impl.c. This will allow the main pwutil code to be
used for lookup methods other than getpw* and getgr*.
Todd C. Miller [Mon, 17 Sep 2012 21:03:17 +0000 (17:03 -0400)]
Rename yyerror() to sudoerserror() to match yacc prefix changes.
Not really needed due to the #defines that yacc makes but it is
less confusing this way as the lexer calls sudoerserror().
Todd C. Miller [Sun, 16 Sep 2012 19:18:58 +0000 (15:18 -0400)]
Replace the guts of sudo_setenv_nodebug() with our old setenv.c
which supports non-standard BSD and glibc semantics.
sudo_setenv() now simply calls sudo_setenv2().