Todd C. Miller
88c6446daf
Do locale swapping in the warning()/error() macros themselves instead
...
of in the underlying functions.
2012-11-25 09:34:15 -05:00
Todd C. Miller
4bde57b8b2
Rename warning2()/error2() -> warning_nodebug()/error_nodebug().
2012-11-25 09:34:10 -05:00
Todd C. Miller
7b3d268687
Call gettext() on parameters for warning()/warningx() instead of
...
having warning() do it for us.
2012-11-25 09:34:04 -05:00
Todd C. Miller
3b5f786994
No need to change locale in front-end warning()/error().
2012-11-25 09:25:15 -05:00
Todd C. Miller
8195fe1bd2
repair spacing
2012-11-13 08:54:31 -05:00
Todd C. Miller
acf8af9aac
#unifdef HAVE_SETLOCALE, it is C89 so no need to check for it.
2012-11-12 08:51:58 -05:00
Todd C. Miller
c1db4b1546
Always include locale.h from gettext.h so we no longer need to
...
include locale.h from the .c files.
2012-11-11 20:23:53 -05:00
Todd C. Miller
83dde2fbb6
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.
2012-11-11 07:11:22 -05:00
Todd C. Miller
595d3b2651
Display warning/error messages in the user's locale.
2012-11-08 15:37:44 -05:00
Todd C. Miller
f8660f9988
Add variants of warn/error and sudo_debug_printf that take a va_list
...
instead of a variable number of args.
2012-11-08 15:37:42 -05:00
Todd C. Miller
e6207003b1
The -a option should be #ifdef HAVE_BSD_AUTH_H, not -A.
2012-11-06 11:00:22 -05:00
Todd C. Miller
84eedd3f79
sudo_ttyname_dev() is unused if there is no /proc or sysctl().
2012-10-02 15:29:52 -04:00
Todd C. Miller
a3a1574cdf
Explicitly mark main() as public in executables to avoid an HP-UX
...
ld warning.
2012-10-02 15:08:02 -04:00
Todd C. Miller
592f6fefb0
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.
2012-09-25 13:49:51 -04:00
Todd C. Miller
616d713e9b
Handle SIGCONT_FG and SIGCONT_BG when converting signal number to
...
string in deliver_signal().
2012-09-25 13:31:20 -04:00
Todd C. Miller
0e94e8ca91
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.
2012-09-24 15:06:14 -04:00
Todd C. Miller
1d90c0ad71
No need to translate "unable to allocate memory" when we can just
...
use the system translation via strerror().
2012-09-17 16:59:26 -04:00
Todd C. Miller
885b6e7cda
When setting the signal handler for SIGTSTP to the default value
...
in non-I/O log mode, store the old handler value for when we restore
it after resume.
2012-09-16 18:40:39 -04:00
Todd C. Miller
a71e685aa9
regen .po files
2012-09-01 17:10:36 -04:00
Todd C. Miller
ae21fb299d
Silence compiler warnings.
2012-08-29 14:40:25 -04:00
Todd C. Miller
ab7dda035a
Replace strsigname() with sig2str(), emulating it as needed.
2012-08-29 14:25:09 -04:00
Todd C. Miller
71e2d8290b
Use fseeko() for legacy utmp handling if available.
2012-08-29 10:32:49 -04:00
Todd C. Miller
37269d662a
Pass on SIGTSTP to the command if it was sent by a user process
...
(not the kernel or the terminal) when we are not I/O logging and
set the default SIGTSTP handler when we re-send the signal to
ourself, restoring our handler after we resume.
2012-08-27 11:22:33 -04:00
Todd C. Miller
29907e357c
Shells typically change their process group when they start up so
...
that they can implement job control. Most well-behaved shells
change the pgrp back to its original value before suspending so we
must not try to restore in that case, lest we race with the child
upon resume, potentially stopping sudo with SIGTTOU while the command
continues to run. Some shells, such as pdksh, just suspend the
shell by sending SIGSTOP to themselves without restoring the pgrp.
In this case we need to change the pgrp back for them.
Should fix bug #568
2012-08-27 10:29:59 -04:00
Todd C. Miller
537dc94b9e
Use strsigname() to print signal names in the debug output.
...
If the system has no strsigname(), use our own.
2012-08-26 20:12:51 -04:00
Todd C. Miller
81d42ae4e6
sync with translationproject.org
2012-08-22 12:56:28 -04:00
Todd C. Miller
57f1c7fe05
Sync with translationproject.org and add Italian sudoers translation.
2012-08-17 09:56:44 -04:00
Todd C. Miller
805039bec5
Add missing check for I/O plugin API version when checking for the
...
presence of I/O plugin hooks.
2012-08-13 14:44:54 -04:00
Todd C. Miller
f32aaed29d
Can't call debug code in the process_hooks_xxx functions() since
...
ctime() may look up the timezone via the TZ environment variable.
2012-08-13 14:39:40 -04:00
Todd C. Miller
e4e815dd82
Include signal.h before sudo_exec.h since it uses sigset_t * in the
...
fork_pty prototype.
2012-08-10 15:29:07 -04:00
Todd C. Miller
66ad86594e
regen
2012-08-10 13:18:19 -04:00
Todd C. Miller
ef33ee45d9
Sync with translationproject.org and add new Slovenian translation.
2012-08-10 13:07:53 -04:00
Todd C. Miller
a7424cc002
If sudo.conf contains an I/O plugin but no policy plugin, use sudoers
...
for the policy plugin. If a policy plugin is specified without an
I/O plugin, only the policy plugin will be loaded.
2012-08-09 14:11:41 -04:00
Todd C. Miller
0655deab57
Fix a comment, update a variable name in a prototype; all cosmetic.
2012-08-07 14:47:58 -04:00
Todd C. Miller
dc08cf3c99
If we receive a signal from the command we executed, do not forward
...
it back to the command. This fixes a problem with BSD-derived
versions of the reboot command which send SIGTERM to all other
processes, including the sudo process. Sudo would then deliver
SIGTERM to reboot which would die before calling the reboot() system
call, effectively leaving the system in single user mode.
2012-08-06 14:38:35 -04:00
Todd C. Miller
5e502bd6d6
When checking whether a signal is user-generated, compare si_code
...
against SI_USER instead of <= 0 since on HP-UX, terminal-related
signals get a code of 0.
2012-07-31 13:36:48 -04:00
Todd C. Miller
9c321baa78
SuSE Enterprise Linux uses RLIMIT_NPROC and _SC_CHILD_MAX interchangably.
...
This causes problems when setting RLIMIT_NPROC to RLIM_INFINITY due
to a bug in bash where bash tries to honor the value of _SC_CHILD_MAX
but treats a value of -1 as an error, and uses a default value of
32 instead.
Previously, we just checked RLIMIT_NPROC and, if it was unlimited,
restored the previous value of RLIMIT_NPROC. However, that makes
it impossible to set nproc to unlimited. We now only restore the
nproc resource limit if sysconf(_SC_CHILD_MAX) is negative. In
most cases, pam_limits will set RLIMIT_NPROC for us.
2012-07-31 11:11:25 -04:00
Todd C. Miller
4abd2a6cf4
Merge in Solaris privilege support by Darren Moffat and John Zolnowsky
2012-07-26 13:49:21 -04:00
Todd C. Miller
f8f0021710
Add configure check for building PIE executables instead of doing
...
it in mkpkg.
2012-07-02 10:12:41 -04:00
Todd C. Miller
faf89fc792
It is safe to read in sudo.conf before calling user_info().
2012-06-27 15:17:18 -04:00
Todd C. Miller
9497df293a
Don't run regress tests or sudoers sanity check (using the newly-built
...
visudo) when cross compiling. Bug #560
2012-06-20 13:38:17 -04:00
Todd C. Miller
b0475b59dc
Remove extraneous backslash
2012-06-20 12:32:51 -04:00
Todd C. Miller
85c6078659
Simplify "sudo -s" argv rewriting.
2012-06-14 16:17:15 -04:00
Todd C. Miller
47abbb90a2
Don't use a map file for sudo_noexec.so since Solaris ld doesn't
...
allow '*' in the global section. The libtool export flag is now
added to LT_LDFLAGS instead of commenting/uncommenting lines.
2012-06-14 11:35:02 -04:00
Todd C. Miller
6f6b0dec6c
Use gcc's visibility attribute to specify when symbols are visible
...
or hidden, if available. If not available, use an ELF version
script if it is supported. If all else fails, fall back to using
libtool's -export-symbols.
2012-06-13 14:01:16 -04:00
Todd C. Miller
a8e0687ca9
Install shared objects with mode 0644 except on HP-UX which needs
...
the executable bit set.
2012-06-11 10:45:34 -04:00
Todd C. Miller
c131cb36f5
Make installed file modes consistent with the file modes in the
...
sudo package.
2012-06-11 10:17:19 -04:00
Todd C. Miller
61a3ed1c10
Install sudoedit and the sudoedit manual as symbolic links, not
...
hard links and package them as such.
2012-05-31 15:50:16 -04:00
Todd C. Miller
af9492d117
Provide unhooked version of getenv() and use it when looking up
...
DISPLAY and SUDO_ASKPASS in the environment.
2012-05-27 12:48:55 -04:00
Todd C. Miller
466a126c69
The pointer to the siginfo_t struct in a signal handler may be NULL.
2012-05-11 07:57:01 -04:00