Todd C. Miller [Wed, 4 Jan 2012 17:57:06 +0000 (12:57 -0500)]
Handle different Unix domain socket (actually socketpair) semantics
in BSD vs. Linux. In BSD if one end of the socketpair goes away
select() returns the fd as readable and the read will fail with
ECONNRESET. This doesn't appear to happen on Linux so if we notice
that the monitor process has died when I/O logging is enabled,
behave like the command has exited. This means we log the wait
status of the monitor, not the command, but there is nothing else
we can do at that point. This should only be an issue if SIGKILL
is sent to the monitor process.
Todd C. Miller [Wed, 4 Jan 2012 17:56:54 +0000 (12:56 -0500)]
Catch common signals in the monitor process so they get passed to
the command. Fixes a problem when the entire login session is
killed when ssh is disconnected or the terminal window is closed.
Previously, the monitor would exit and plugin's close method would
not be called.
Todd C. Miller [Wed, 4 Jan 2012 17:56:09 +0000 (12:56 -0500)]
Add support for setenv entries in login.conf. We can't use LOGIN_SETENV
since the plugin sets up the envp the command is executed with.
Also regen the Makefile.in files while here. Fixes bug #527
Todd C. Miller [Wed, 4 Jan 2012 17:54:54 +0000 (12:54 -0500)]
Fetch the login class for the user we authenticate specifically when
using BSD authentication. That user may have a different login class
than what we will use to run the command. When setting the login
class for the command, use the target user's struct passwd, not
the invoking user's. Fixes bug 526
Todd C. Miller [Wed, 4 Jan 2012 17:53:53 +0000 (12:53 -0500)]
No longer need SUDO_CHECK_TYPE and SUDO_TYPE_* now that the default
includes have unistd.h in them. Add check for socklen_t for upcoming
getaddrinfo compat.
Todd C. Miller [Wed, 4 Jan 2012 17:47:14 +0000 (12:47 -0500)]
Add devdir before srcdir in include path and fix up dependecies
accordingly and add better devdir support to mkdep.pl. We also
need to #include <gram.h> not "gram.h" and <def_data.h> and not
"def_data.h" when generating the parser in a build dir.
Todd C. Miller [Wed, 4 Jan 2012 17:46:02 +0000 (12:46 -0500)]
Change Debug sudo.conf setting to take a program name as the first
argument. In the future, this will allow visudo and sudoreplay to
use their own Debug entries.
Todd C. Miller [Wed, 4 Jan 2012 17:44:34 +0000 (12:44 -0500)]
Tests for empty sudoers (should parse OK) and syntax errors within
a line (should report correct line number) both with and without
the trailing newline.
Todd C. Miller [Wed, 4 Jan 2012 17:44:03 +0000 (12:44 -0500)]
Keep track of the last token returned. On error, if the last token was
COMMENT, decrement sudolineno since the error most likely occurred on
the preceding line. Previously we always uses sudolineno-1 which will
give the wrong line number for errors within a line.
Todd C. Miller [Wed, 4 Jan 2012 17:42:14 +0000 (12:42 -0500)]
We need to init the auth system regardless of whether we need a
password since we will be closing the PAM session in the monitor
process. Fixes a crash in the monitor on Solaris; bugzilla #518
Todd C. Miller [Wed, 4 Jan 2012 17:40:54 +0000 (12:40 -0500)]
Wrap error/errorx and warning/warningx functions with debug statements.
Disable wrapping for standalone sudoers programs as well as memory
allocation functions (to avoid infinite recursion).
Todd C. Miller [Thu, 8 Dec 2011 16:18:38 +0000 (11:18 -0500)]
Handle different Unix domain socket (actually socketpair) semantics
in BSD vs. Linux. In BSD if one end of the socketpair goes away
select() returns the fd as readable and the read will fail with
ECONNRESET. This doesn't appear to happen on Linux so if we notice
that the monitor process has died when I/O logging is enabled,
behave like the command has exited. This means we log the wait
status of the monitor, not the command, but there is nothing else
we can do at that point. This should only be an issue if SIGKILL
is sent to the monitor process.
Todd C. Miller [Thu, 8 Dec 2011 16:15:53 +0000 (11:15 -0500)]
Catch common signals in the monitor process so they get passed to
the command. Fixes a problem when the entire login session is
killed when ssh is disconnected or the terminal window is closed.
Previously, the monitor would exit and plugin's close method would
not be called.
Todd C. Miller [Mon, 5 Dec 2011 15:43:44 +0000 (10:43 -0500)]
Add support for setenv entries in login.conf. We can't use LOGIN_SETENV
since the plugin sets up the envp the command is executed with.
Also regen the Makefile.in files while here. Fixes bug #527
Todd C. Miller [Fri, 2 Dec 2011 19:29:54 +0000 (14:29 -0500)]
Fetch the login class for the user we authenticate specifically when
using BSD authentication. That user may have a different login class
than what we will use to run the command. When setting the login
class for the command, use the target user's struct passwd, not
the invoking user's. Fixes bug 526
Todd C. Miller [Thu, 1 Dec 2011 16:27:57 +0000 (11:27 -0500)]
No longer need SUDO_CHECK_TYPE and SUDO_TYPE_* now that the default
includes have unistd.h in them. Add check for socklen_t for upcoming
getaddrinfo compat.