Todd C. Miller [Tue, 8 Jun 2010 22:51:20 +0000 (18:51 -0400)]
Add definition of WCOREDUMP for systems without it. This is known
to work on AIX and SunOS 4, but may be incorrect on other systems
that lack WCOREDUMP.
Todd C. Miller [Tue, 8 Jun 2010 20:52:21 +0000 (16:52 -0400)]
If a file in a #includedir has improper permissions or owner just
skip it. This prevents packages that incorrectly install a file
into /etc/sudoers.d from breaking sudo so easily. Syntax errors
in #includedir files still result in a parse error (for now).
Todd C. Miller [Tue, 8 Jun 2010 14:26:15 +0000 (10:26 -0400)]
Instead of trying to keep the global environment in sync with our
private copy, provide our own getenv() that returns values from the
private environment and use env_get() to pass the environment in
to run_command().
Todd C. Miller [Mon, 7 Jun 2010 21:28:05 +0000 (17:28 -0400)]
Split exec.c into exec.c and exec_pty.c
Pass a flag in to sudo_execve to indicate whether we need to
wait for the command to finish (fork + execve vs. execve).
Todd C. Miller [Fri, 4 Jun 2010 21:44:43 +0000 (17:44 -0400)]
Do signal setup after turning off echo, not before. If we are using
a tty but are not the foreground pgrp this will generate SIGTTOU
so we want the default action to be taken (suspend process).
Use an array for signals received instead of a single variable so
we don't lose any when there are multiple different signals.
Todd C. Miller [Thu, 3 Jun 2010 15:31:22 +0000 (11:31 -0400)]
Pass in output function to lbuf_init() instead of writing to stdout.
A side effect is that the usage info can now go to stderr as it
should. Add support for embedded newlines in lbuf and use that
instead of multiple calls to lbuf_print.
Todd C. Miller [Thu, 3 Jun 2010 12:00:31 +0000 (08:00 -0400)]
Store info from stat(2)ing the tty in the tty ticket when tty tickets
are in use. If the tty lives on a devpts (Linux) or devices (Solaris)
filesystem, stash the ctime in the tty ticket file, as it is not
updated when the tty is written to. This helps us determine when
a tty has been reused without the user authenticating again with
sudo.
Todd C. Miller [Wed, 2 Jun 2010 14:25:20 +0000 (10:25 -0400)]
HP-UX ld uses +b instead or -R or -rpath
Fix typo in libvas check
libvas may need libdl for dlopen()
Add missing template for ENV_DEBUG
Adapted from Quest sudo
Todd C. Miller [Fri, 28 May 2010 13:45:01 +0000 (09:45 -0400)]
Handle duplicate variables in the environment. For unsetenv(),
keep looking even after remove the first instance. For sudo_putenv(),
check for and remove dupes after we replace an existing value.
Todd C. Miller [Wed, 14 Apr 2010 10:24:27 +0000 (06:24 -0400)]
Set errorfile to the sudoers path if we set parse_error manually.
This prevents a NULL dereference in printf() when checking a sudoers
file in strict mode when alias errors are present.
Todd C. Miller [Fri, 9 Apr 2010 10:10:07 +0000 (06:10 -0400)]
Qualify the command even if it is in the current working directory,
e.g. "./foo" instead of just returning "foo". This removes an ambiguity
between real commands and possible pseudo-commands in command matching.
Todd C. Miller [Mon, 8 Mar 2010 19:27:30 +0000 (14:27 -0500)]
Use parent process group id instead of parent process id when checking
foreground status and suspending parent. Fixes an issue when running
commands under /usr/bin/time and others.
Todd C. Miller [Sat, 26 Dec 2009 01:49:25 +0000 (01:49 +0000)]
Set stdin to non-blocking mode early instead of in check_input.
Use term_raw instead of term_cbreak since the data we get has
already been expanded via OPOST.
Todd C. Miller [Wed, 23 Dec 2009 23:53:04 +0000 (23:53 +0000)]
Enable/disable all postprocessing instead of just nl->crnl processing
since things like tab expansion matter too. However, if stdout is
a tty leave postprocessing on in the pty since we run into problems
doing it only on the real stdout with .e.g nvi.
Todd C. Miller [Sun, 15 Nov 2009 21:53:38 +0000 (21:53 +0000)]
Start command out in foreground mode if stdout is a tty. Works
around issues with some curses-based programs that don't handle
tcsetattr getting interrupted by a signal. Still allows us to
avoid hogging the tty if the command is part of a pipeline.
Todd C. Miller [Sun, 15 Nov 2009 21:42:17 +0000 (21:42 +0000)]
Use a socketpair to pass signals from parent to child. Child will
now pass command status change info back via the socketpair. This
allows the parent to distinguish between signals it has been sent
directly and signals the command has received. It also means the
parent can once again print the signal notifications to the tty so
all writes to the pty master occur in the parent. The command is
now always started in background mode with tty signals handled
by the parent.
Todd C. Miller [Wed, 4 Nov 2009 14:42:04 +0000 (14:42 +0000)]
Fix a few typos in the descriptions; from Jeff Makey
Only do the check for krb5_get_init_creds_opt_free() taking two
arguments if we find krb5_get_init_creds_opt_alloc(). Otherwise
we will get a false positive when using our own
krb5_get_init_creds_opt_free which takes only a single argument.