Todd C. Miller
6fe6ccb048
Fix potential stack overflow due to infinite recursion in alias
...
cycle detection. From Daniel Kopecek.
2013-01-23 07:52:09 -05:00
Todd C. Miller
ef8e141248
Ignore duplicate entries in sudo.conf and report the line number
...
when there is an error. Warn, don't abort if there is more than
one policy plugin.
2013-01-23 06:33:53 -05:00
Todd C. Miller
c00c968010
Use strtoul() not atoi().
2013-01-23 06:21:45 -05:00
Todd C. Miller
0fdb89e3b3
regen depends for to add compat/nss_dbdefs.h for getgrouplist.lo
2013-01-22 15:48:52 -05:00
Todd C. Miller
e1859cac14
Fix typo that breaks the build on HP-UX.
2013-01-22 15:48:16 -05:00
Todd C. Miller
6bc3d4aed5
Use nss_search() to implement getgrouplist() where available. Tested
...
on Solaris and HP-UX. We need to include a compatibility header
for HP-UX which uses the Solaris nsswitch implementation but doesn't
ship nss_dbdefs.h.
2013-01-22 15:41:15 -05:00
Todd C. Miller
e764604485
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.
2013-01-19 15:10:01 -05:00
Todd C. Miller
a06a14838f
Use _getgroupsbymember() on Solaris to get the groups list. Fixes
...
performance problems with the getgroupslist() compat on Solaris
systems with network-based group databases.
2013-01-18 14:58:12 -05:00
Todd C. Miller
872e168836
Document signal handler behavior in plugin API 1.3
2013-01-17 15:13:32 -05:00
Todd C. Miller
855a11af2b
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.
2013-01-17 13:29:46 -05:00
Todd C. Miller
99704cc101
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.
2013-01-17 09:20:45 -05:00
Todd C. Miller
541315212e
Rename handle_signals() to dispatch_signals().
...
Block other signals in handler() so we don't have to worry about
the write() being interrupted.
2013-01-17 09:17:54 -05:00
Todd C. Miller
2be741d8ae
Rename signal handler to avoid name clash with one in exec.c
2013-01-16 15:28:36 -05:00
Todd C. Miller
90c6ace770
Add missing call to save_signals().
2013-01-13 15:24:12 -05:00
Todd C. Miller
70976f30ea
Fill in the comment block at the top of the .pot files and preserve
...
it when regenerating them.
2013-01-11 17:08:49 -05:00
Todd C. Miller
9479bb623b
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.
2013-01-11 14:34:09 -05:00
Todd C. Miller
a6f3517f23
regen
2013-01-11 14:29:37 -05:00
Todd C. Miller
64bf4bb057
Add SESH_OBJS variable for sesh object files.
2013-01-11 14:28:52 -05:00
Todd C. Miller
4bc616b677
Update copyright year.
2013-01-11 14:14:10 -05:00
Todd C. Miller
8b3edcc4a8
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.
2013-01-11 10:09:06 -05:00
Todd C. Miller
adbc8a574f
Use -fstack-protector-all in preference to -fstack-protector
...
where supported.
2013-01-11 09:39:59 -05:00
Todd C. Miller
34d018fb91
Only test for -fstack-protector and -fvisibility=hidden on GNU
...
compatible compilers.
2013-01-10 21:27:40 -05:00
Todd C. Miller
726a7daa63
Add Sudo 1.8.6p4
2013-01-03 14:52:10 -05:00
Todd C. Miller
6e560f2bab
Break out stack smashing protector options into SSP_CFLAGS and
...
SSP_LDFLAGS so we can use it everywhere (unlike LT_LDFLAGS).
2013-01-03 14:20:49 -05:00
Todd C. Miller
90d58685ff
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
2013-01-01 13:31:40 -05:00
Todd C. Miller
782da0aa81
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.
2012-12-28 11:03:23 -05:00
Todd C. Miller
d129290ec3
Print SIGCONT_FG and SIGCONT_BG properly in debug output.
2012-12-28 11:01:36 -05:00
Todd C. Miller
948253a156
Disable PIE on FreeBSD/ia64, otherwise sudo will segfault.
2012-12-27 16:25:51 -05:00
Todd C. Miller
a449e8b3e7
Add howmany() macro since some systems have this in sys/param.h
...
which we no longer include.
2012-12-20 14:46:45 -05:00
Todd C. Miller
652d0de98a
Remove errant file.
2012-12-07 14:58:06 -05:00
Todd C. Miller
3391038d49
Remove obsolete sudoers_cleanup() stubs.
2012-12-04 10:41:59 -05:00
Todd C. Miller
1d7072fe09
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.
2012-12-04 10:40:47 -05:00
Todd C. Miller
3c9da162e4
Use MAX_HOST_NAME+1 (limits.h) instead of MAXHOSTNAMELEN (sys/param.h
...
or netdb.h).
2012-12-04 10:18:41 -05:00
Todd C. Miller
9a1889a61c
Move debug_decl() in log_failure() to be after the variable
...
declarations for C89.
2012-11-30 11:39:27 -05:00
Todd C. Miller
b7ae7977a6
Cannot wrap sigsetjmp() or we end up returning to the wrong place.
...
Use a macro instead.
2012-11-29 06:37:13 -05:00
Todd C. Miller
02ad501ecc
Fix return in sudoers_policy_open that should be debug_return.
2012-11-28 16:48:04 -05:00
Todd C. Miller
d3ab8b080b
Define sudo_ttyname_dev() for the HAVE_STRUCT_PSINFO_PR_TTYDEV case
...
too.
2012-11-27 10:49:46 -05:00
Todd C. Miller
dd5d0eada7
Quiet a gcc warning and add comment about needing to keep the
...
handle open.
2012-11-27 10:29:55 -05:00
Todd C. Miller
a94e94cf8c
mention --disable-shared
2012-11-26 15:25:19 -05:00
Todd C. Miller
94e2b1fbd4
Add missing command_info argument in I/O plugin open() prototype.
...
Bug #579
2012-11-26 09:57:35 -05:00
Todd C. Miller
1660c2692a
Regen for proper line numbers.
2012-11-25 11:55:33 -05:00
Todd C. Miller
415dc82971
Add locale_stub.o to SUDO_OBJS, not locale_stub.lo.
2012-11-25 11:54:17 -05:00
Todd C. Miller
14e5f35d4d
Include missing.h for __printflike.
2012-11-25 11:51:43 -05:00
Todd C. Miller
727be29893
Saner loop invariant in io_mkdirs (cosmetic only).
2012-11-25 09:46:40 -05:00
Todd C. Miller
2632ec7e69
Move warn/error into common and make static builds work.
2012-11-25 09:34:40 -05:00
Todd C. Miller
c2c6616a0c
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.
2012-11-25 09:34:33 -05:00
Todd C. Miller
5496ffe1e8
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().
2012-11-25 09:34:26 -05:00
Todd C. Miller
d658d12195
Let warning() call gettext() for us.
2012-11-25 09:34:20 -05:00
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