]> granicus.if.org Git - sudo/log
sudo
14 years agoHandle duplicate variables in the environment. For unsetenv(),
Todd C. Miller [Fri, 28 May 2010 13:42:50 +0000 (09:42 -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.

14 years agoUse explicit path to source file instead of $< for files that live
Todd C. Miller [Thu, 27 May 2010 22:11:51 +0000 (18:11 -0400)]
Use explicit path to source file instead of $< for files that live
in devdir and top_srcdir.

14 years agoAdd explicit rules to compile gram.c and toke.c for HP-UX
Todd C. Miller [Thu, 27 May 2010 22:00:08 +0000 (18:00 -0400)]
Add explicit rules to compile gram.c and toke.c for HP-UX
Pevent ending LIBSUDOERS_OBJS with a backslash

14 years agoLink libcommon before libreplace since libcommon may use functions
Todd C. Miller [Thu, 27 May 2010 21:48:17 +0000 (17:48 -0400)]
Link libcommon before libreplace since libcommon may use functions
only present in libreplace.

14 years agoMove code common to sudo and the sudoers plugin to a convenience library,
Todd C. Miller [Thu, 27 May 2010 21:29:09 +0000 (17:29 -0400)]
Move code common to sudo and the sudoers plugin to a convenience library,
libcommon.  Removes the need to make links in the sudoers plugin dir
and reduces re-compilation of duplicate object files.

14 years agoMove code common to sudo and the sudoers plugin to a convenience library,
Todd C. Miller [Thu, 27 May 2010 21:27:36 +0000 (17:27 -0400)]
Move code common to sudo and the sudoers plugin to a convenience library,
libcommon.  Removes the need to make links in the sudoers plugin dir
and reduces re-compilation of duplicate object files.

14 years agoRename script_execve to sudo_execve and rename script_foo in exec.c
Todd C. Miller [Thu, 27 May 2010 20:46:31 +0000 (16:46 -0400)]
Rename script_execve to sudo_execve and rename script_foo in exec.c

14 years agorename script.c exec.c and fix up the MANIFEST file
Todd C. Miller [Thu, 27 May 2010 20:32:41 +0000 (16:32 -0400)]
rename script.c exec.c and fix up the MANIFEST file

14 years agoRename script_setup() to pty_setup() and call from script_execve()
Todd C. Miller [Thu, 27 May 2010 20:29:48 +0000 (16:29 -0400)]
Rename script_setup() to pty_setup() and call from script_execve()
directly.

14 years agobump version to 1.8.0a2
Todd C. Miller [Thu, 27 May 2010 19:09:05 +0000 (15:09 -0400)]
bump version to 1.8.0a2

14 years agoDocument init_session
Todd C. Miller [Thu, 27 May 2010 19:07:43 +0000 (15:07 -0400)]
Document init_session

14 years agoClean up the sudoers auth API a bit and update the docs.
Todd C. Miller [Thu, 27 May 2010 18:53:11 +0000 (14:53 -0400)]
Clean up the sudoers auth API a bit and update the docs.

14 years agoAdd init_session function to struct policy_plugin that gets called
Todd C. Miller [Thu, 27 May 2010 18:46:39 +0000 (14:46 -0400)]
Add init_session function to struct policy_plugin that gets called
before the uid/gid/etc changes.  A struct passwd pointer is passed in,which may be NULL if the user does not exist in the passwd database.The sudoers module uses init_session to open the pam session as needed.

14 years agoAdd open/close session to sudo auth, only used by PAM.
Todd C. Miller [Wed, 26 May 2010 21:57:47 +0000 (17:57 -0400)]
Add open/close session to sudo auth, only used by PAM.
This allows us to open (and close) the PAM session from sudoers.

14 years agoAdd explicit rule to build getdate.o for HP-UX make.
Todd C. Miller [Wed, 26 May 2010 21:20:21 +0000 (17:20 -0400)]
Add explicit rule to build getdate.o for HP-UX make.

14 years agoBack out most of change 45e406ebdea2. Create dummy .l.c and .y.c
Todd C. Miller [Wed, 26 May 2010 21:01:00 +0000 (17:01 -0400)]
Back out most of change 45e406ebdea2.  Create dummy .l.c and .y.c
rules as an alternate way to prevent HP-UX make (and others) from
trying to rebuild the parser in non-dev mode.

14 years agoRe-enable PATH_MAX check for command
Todd C. Miller [Wed, 26 May 2010 20:33:35 +0000 (16:33 -0400)]
Re-enable PATH_MAX check for command

14 years agoFor distclean, clean the main directory last since the subdirs
Todd C. Miller [Wed, 26 May 2010 20:10:24 +0000 (16:10 -0400)]
For distclean, clean the main directory last since the subdirs
need to be able to run libtool to clean things.

14 years agoFix generation of mksiglist.h
Todd C. Miller [Wed, 26 May 2010 19:43:46 +0000 (15:43 -0400)]
Fix generation of mksiglist.h

14 years agoNow that we defer sending cstat until the end of script_child()
Todd C. Miller [Wed, 26 May 2010 15:19:17 +0000 (11:19 -0400)]
Now that we defer sending cstat until the end of script_child()
we cannot reuse cstat when reading command status from parent.

14 years agoUse numeric registers to handle conditionals instead of trying
Todd C. Miller [Tue, 25 May 2010 20:13:04 +0000 (16:13 -0400)]
Use numeric registers to handle conditionals instead of trying
to do it all with text processing.

14 years agoDocument per-command SELinux settings
Todd C. Miller [Tue, 25 May 2010 18:43:39 +0000 (14:43 -0400)]
Document per-command SELinux settings

14 years agoRepair "sudo -l -U username"
Todd C. Miller [Tue, 25 May 2010 18:21:21 +0000 (14:21 -0400)]
Repair "sudo -l -U username"

14 years agoSet selinux role and type in command details.
Todd C. Miller [Tue, 25 May 2010 17:58:16 +0000 (13:58 -0400)]
Set selinux role and type in command details.

14 years agoRework SELinux support.
Todd C. Miller [Tue, 25 May 2010 15:00:39 +0000 (11:00 -0400)]
Rework SELinux support.

14 years agoMake SELinux support compile again. Needs more work to be complete.
Todd C. Miller [Mon, 24 May 2010 22:18:50 +0000 (18:18 -0400)]
Make SELinux support compile again.  Needs more work to be complete.

14 years agoBring back closefrom settings.
Todd C. Miller [Mon, 24 May 2010 19:40:36 +0000 (15:40 -0400)]
Bring back closefrom settings.

14 years agoIf running a command or sudoedit in transcript mode, call io_nextid()
Todd C. Miller [Mon, 24 May 2010 18:30:54 +0000 (14:30 -0400)]
If running a command or sudoedit in transcript mode, call io_nextid()
before log_allowed() so the session id is logged.

14 years agoUse mandoc(1) if nroff(1) is not present.
Todd C. Miller [Mon, 24 May 2010 16:35:43 +0000 (12:35 -0400)]
Use mandoc(1) if nroff(1) is not present.

14 years agoUse the --file argument to config.status instead of setting CONFIG_FILES
Todd C. Miller [Mon, 24 May 2010 16:25:20 +0000 (12:25 -0400)]
Use the --file argument to config.status instead of setting CONFIG_FILES
in the environment.

14 years agoWe cannot conditionally update gram.h or the dependency ordering gets
Todd C. Miller [Mon, 24 May 2010 16:10:05 +0000 (12:10 -0400)]
We cannot conditionally update gram.h or the dependency ordering gets
messed up in devel mode.

14 years agoSubstitute @SHELL@ into Makefiles
Todd C. Miller [Sat, 22 May 2010 01:29:44 +0000 (21:29 -0400)]
Substitute @SHELL@ into Makefiles

14 years agoFix typo
Todd C. Miller [Sat, 22 May 2010 01:05:44 +0000 (21:05 -0400)]
Fix typo

14 years agoUpdate to autoconf 2.65
Todd C. Miller [Fri, 21 May 2010 23:25:17 +0000 (19:25 -0400)]
Update to autoconf 2.65

14 years agoFix libtool target (space vs. tabs)
Todd C. Miller [Fri, 21 May 2010 22:41:18 +0000 (18:41 -0400)]
Fix libtool target (space vs. tabs)

14 years agoRemove use of RETSIGTYPE; all modern systems have signal handlers that
Todd C. Miller [Fri, 21 May 2010 22:40:04 +0000 (18:40 -0400)]
Remove use of RETSIGTYPE; all modern systems have signal handlers that
return void.

14 years agoUpdate to libtool-2.2.6b. I haven't made any local modifications
Todd C. Miller [Fri, 21 May 2010 21:59:47 +0000 (17:59 -0400)]
Update to libtool-2.2.6b.  I haven't made any local modifications
this time, which should be OK since we install sudo_noexec.so by
hand now.

14 years agoUse libtool to clean objects
Todd C. Miller [Fri, 21 May 2010 20:53:21 +0000 (16:53 -0400)]
Use libtool to clean objects

14 years agoInstall sudo_plugin.h as part of "make install" and make other install
Todd C. Miller [Fri, 21 May 2010 20:52:31 +0000 (16:52 -0400)]
Install sudo_plugin.h as part of "make install" and make other install
targets callable from the top-level Makefile

14 years agoregen with autoupdate to eliminate AC_TRY_LINK
Todd C. Miller [Fri, 21 May 2010 19:53:39 +0000 (15:53 -0400)]
regen with autoupdate to eliminate AC_TRY_LINK

14 years agoInstall sudo_plugin.h as part of "make install" and make other install
Todd C. Miller [Fri, 21 May 2010 19:31:36 +0000 (15:31 -0400)]
Install sudo_plugin.h as part of "make install" and make other install
targets callable from the top-level Makefile

14 years agoThe sample plugin doesn't support being run with no args so return
Todd C. Miller [Fri, 21 May 2010 18:56:31 +0000 (14:56 -0400)]
The sample plugin doesn't support being run with no args so return
a usage error in this case.

14 years agoSet close on exec flag for descriptors used for I/O logging so they
Todd C. Miller [Fri, 21 May 2010 18:51:50 +0000 (14:51 -0400)]
Set close on exec flag for descriptors used for I/O logging so they
are not present in the command being run.

14 years agoSet close on exec flag in private versions of setpwent() and setgrent().
Todd C. Miller [Fri, 21 May 2010 18:51:05 +0000 (14:51 -0400)]
Set close on exec flag in private versions of setpwent() and setgrent().

14 years agoClose the I/O pipes aftering dup2()ing them to std{in,out,err}.
Todd C. Miller [Fri, 21 May 2010 18:50:26 +0000 (14:50 -0400)]
Close the I/O pipes aftering dup2()ing them to std{in,out,err}.
Fixes extra fds being present in the command when it is part of a pipeline.

14 years agoSet user_tty to "unknown" if there is no tty, like sudo 1.7 does
Todd C. Miller [Fri, 21 May 2010 16:19:55 +0000 (12:19 -0400)]
Set user_tty to "unknown" if there is no tty, like sudo 1.7 does
(it is used when logging).  Note that user_ttypath will still be
NULL if there is no tty.

14 years agoCosmetic changes:
Todd C. Miller [Fri, 21 May 2010 16:01:11 +0000 (12:01 -0400)]
Cosmetic changes:
    add comments, remove orphaned prototype and make a global static.

14 years agoMove check for maxfd == -1 to flush_output where it belongs.
Todd C. Miller [Thu, 20 May 2010 21:34:53 +0000 (17:34 -0400)]
Move check for maxfd == -1 to flush_output where it belongs.

14 years agoBreak out of select loop if all the fds we want to select on are -1.
Todd C. Miller [Thu, 20 May 2010 21:13:22 +0000 (17:13 -0400)]
Break out of select loop if all the fds we want to select on are -1.

14 years agoAvoid possible malloc(0) if plugin returns an empty groups list.
Todd C. Miller [Thu, 20 May 2010 21:10:16 +0000 (17:10 -0400)]
Avoid possible malloc(0) if plugin returns an empty groups list.

14 years agoAdd debugging info when calling plugin close function
Todd C. Miller [Thu, 20 May 2010 21:01:53 +0000 (17:01 -0400)]
Add debugging info when calling plugin close function

14 years agoAvoid closing stdin/stdout/stderr when we are piping output.
Todd C. Miller [Thu, 20 May 2010 21:01:27 +0000 (17:01 -0400)]
Avoid closing stdin/stdout/stderr when we are piping output.

14 years agoWhen execve() of the command fails, it is possible to receive SIGCHLD
Todd C. Miller [Thu, 20 May 2010 11:33:14 +0000 (07:33 -0400)]
When execve() of the command fails, it is possible to receive SIGCHLD
before we've read the error status from the pipe.  Re-order things
such that we send the final status at the very end and prefer error
status over wait status.

14 years agoFix compilation for non PAM/BSD auth/AIX auth
Todd C. Miller [Wed, 19 May 2010 15:40:46 +0000 (11:40 -0400)]
Fix compilation for non PAM/BSD auth/AIX auth

14 years agoAdditional checks to make sure we don't close /dev/tty by mistake.
Todd C. Miller [Tue, 18 May 2010 22:50:20 +0000 (18:50 -0400)]
Additional checks to make sure we don't close /dev/tty by mistake.
When flushing, sleep in select as long as we have buffers that need
to be written out.

14 years agoNow that we can use pipes for stdin/stdout/stderr there is no
Todd C. Miller [Tue, 18 May 2010 21:43:10 +0000 (17:43 -0400)]
Now that we can use pipes for stdin/stdout/stderr there is no
longer a need to error out when there is no tty.  We just need
to make sure we don't try to use the tty fd if it is -1.

14 years agoAdd argc and argv to I/O logger open function.
Todd C. Miller [Mon, 17 May 2010 14:38:56 +0000 (10:38 -0400)]
Add argc and argv to I/O logger open function.

14 years agoRemove check_sudoedit function pointer in struct sudo_policy.
Todd C. Miller [Mon, 17 May 2010 14:25:27 +0000 (10:25 -0400)]
Remove check_sudoedit function pointer in struct sudo_policy.
Instead, sudo will set sudoedit=true in the settings array.
The plugin should check for this and modify argv_out as appropriate
in check_policy.

14 years agoIf plugin sets "sudoedit=true" in the command info, enable
Todd C. Miller [Sun, 16 May 2010 23:27:04 +0000 (19:27 -0400)]
If plugin sets "sudoedit=true" in the command info, enable
sudoedit mode even if not invoked as sudoedit.  This allows
a plugin to enable sudoedit when the user runs an editor.

14 years agogram.h must not depend on gram.y if we want to avoid unnecessary
Todd C. Miller [Sat, 15 May 2010 19:12:06 +0000 (15:12 -0400)]
gram.h must not depend on gram.y if we want to avoid unnecessary
rebuilding of targets dependent on gram.h when gram.y changes.

14 years agoRefactor common bits of check_policy and check_edit
Todd C. Miller [Sat, 15 May 2010 15:51:00 +0000 (11:51 -0400)]
Refactor common bits of check_policy and check_edit

14 years agoAdd sudoedit support
Todd C. Miller [Sat, 15 May 2010 11:51:24 +0000 (07:51 -0400)]
Add sudoedit support

14 years agoRely more on VPATH; fixes a dependency issue with the parser.
Todd C. Miller [Fri, 14 May 2010 22:31:21 +0000 (18:31 -0400)]
Rely more on VPATH; fixes a dependency issue with the parser.

14 years agoFix typo introduced in last commit
Todd C. Miller [Fri, 14 May 2010 20:49:22 +0000 (16:49 -0400)]
Fix typo introduced in last commit

14 years agoEmulate seteuid using setreuid() or setresuid() as needed.
Todd C. Miller [Fri, 14 May 2010 20:43:55 +0000 (16:43 -0400)]
Emulate seteuid using setreuid() or setresuid() as needed.
There are still a few places that call seteuid() directly.

14 years agoAttempt to fix building on systems that only have setuid.
Todd C. Miller [Fri, 14 May 2010 20:35:03 +0000 (16:35 -0400)]
Attempt to fix building on systems that only have setuid.

14 years agoClarify sudoedit a tad.
Todd C. Miller [Fri, 14 May 2010 13:39:01 +0000 (09:39 -0400)]
Clarify sudoedit a tad.

14 years agoFix compilation on HP-UX
Todd C. Miller [Fri, 14 May 2010 00:10:21 +0000 (20:10 -0400)]
Fix compilation on HP-UX

14 years agoDocument sudoedit
Todd C. Miller [Thu, 13 May 2010 21:49:52 +0000 (17:49 -0400)]
Document sudoedit

14 years agoChange how we handle the sudoedit argv. We now require that there
Todd C. Miller [Thu, 13 May 2010 21:11:31 +0000 (17:11 -0400)]
Change how we handle the sudoedit argv.  We now require that there
be a "--" in argv to separate the editor and any command line arguments
from the files to be edited.

14 years agoWork in progress support for sudoedit. The actual interface used by the
Todd C. Miller [Thu, 13 May 2010 18:09:21 +0000 (14:09 -0400)]
Work in progress support for sudoedit.  The actual interface used by the
plugin for sudoedit is likely to change.

14 years agoMake find_path() a little more generic by not checking def_foo
Todd C. Miller [Thu, 13 May 2010 14:27:03 +0000 (10:27 -0400)]
Make find_path() a little more generic by not checking def_foo
variables inside it.  Instead, pass in ignore_dot as a function
argument.

14 years agoAdd version of getenv(3) that uses our own environ pointer.
Todd C. Miller [Thu, 13 May 2010 14:20:40 +0000 (10:20 -0400)]
Add version of getenv(3) that uses our own environ pointer.

14 years agoAvoid a potential race condition if SIGCHLD is received immediately
Todd C. Miller [Wed, 12 May 2010 15:13:40 +0000 (11:13 -0400)]
Avoid a potential race condition if SIGCHLD is received immediately
before we call select().

14 years agoCall env_init() before we open the sudoers sources as those may
Todd C. Miller [Wed, 12 May 2010 12:32:12 +0000 (08:32 -0400)]
Call env_init() before we open the sudoers sources as those may
call our setenv() replacement.

14 years agoInitialize env_len in env_init()
Todd C. Miller [Wed, 12 May 2010 12:31:29 +0000 (08:31 -0400)]
Initialize env_len in env_init()

14 years agoDocument time stamp shortcomings under SECURITY NOTES
Todd C. Miller [Tue, 11 May 2010 19:33:47 +0000 (15:33 -0400)]
Document time stamp shortcomings under SECURITY NOTES
Use "time stamp" instead of timestamp.

14 years agoMake sed substitution of mansectsu and mansectform global.
Todd C. Miller [Tue, 11 May 2010 19:33:08 +0000 (15:33 -0400)]
Make sed substitution of mansectsu and mansectform global.

14 years agoIf the tty lives on a devpts filesystem, stash the ctime in the tty
Todd C. Miller [Tue, 11 May 2010 18:25:14 +0000 (14:25 -0400)]
If the tty lives on a devpts 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.

14 years agoFix pasto in mulitple signal fix and use _NSIG not NSIG since that
Todd C. Miller [Tue, 11 May 2010 17:33:42 +0000 (13:33 -0400)]
Fix pasto in mulitple signal fix and use _NSIG not NSIG since that
is what our compat checks set.

14 years agoAdd check for whether sudo need to link with -ldl to get dlopen().
Todd C. Miller [Tue, 11 May 2010 17:21:50 +0000 (13:21 -0400)]
Add check for whether sudo need to link with -ldl to get dlopen().
This is a bit of a hack that will get reworked when libtool is
updated.

14 years agoFix timestamp removal with -k/-K
Todd C. Miller [Tue, 11 May 2010 17:08:41 +0000 (13:08 -0400)]
Fix timestamp removal with -k/-K

14 years agoaudit.c is now private to the sudoers plugin
Todd C. Miller [Tue, 11 May 2010 16:18:41 +0000 (12:18 -0400)]
audit.c is now private to the sudoers plugin

14 years agoLink with -lpthread on HP-UX since a plugin may be linked with -lpthread
Todd C. Miller [Tue, 11 May 2010 16:11:03 +0000 (12:11 -0400)]
Link with -lpthread on HP-UX since a plugin may be linked with -lpthread
and dlopen() will fail if the shared object has a dependency on -lpthread
but the main program is not linked with it.

14 years agoAdd separate test for getresuid() since HP-UX has setresuid() but no
Todd C. Miller [Tue, 11 May 2010 14:55:59 +0000 (10:55 -0400)]
Add separate test for getresuid() since HP-UX has setresuid() but no
getresuid().

14 years agoRemove errant backslash
Todd C. Miller [Tue, 11 May 2010 14:07:12 +0000 (10:07 -0400)]
Remove errant backslash

14 years agoFix SIGPIPE handling. Now that we use may use pipes for stdin/stdout
Todd C. Miller [Tue, 11 May 2010 12:59:59 +0000 (08:59 -0400)]
Fix SIGPIPE handling.  Now that we use may use pipes for stdin/stdout
we need to pass any SIGPIPE we receive to the running command.

14 years agoAlso start the command in the background if stdin is not a tty.
Todd C. Miller [Tue, 11 May 2010 12:12:02 +0000 (08:12 -0400)]
Also start the command in the background if stdin is not a tty.

14 years agoNo need to use pseudo-cbreak mode now that we use pipes when stdout is
Todd C. Miller [Mon, 10 May 2010 21:23:35 +0000 (17:23 -0400)]
No need to use pseudo-cbreak mode now that we use pipes when stdout is
not a tty.  Instead, check whether stdin is a tty and if not, delay
setting the tty to raw mode until the command tries to access it itself
(and receives SIGTTIN or SIGTTOU).

14 years agoUse an array for signals received instead of a single variable so
Todd C. Miller [Mon, 10 May 2010 19:13:48 +0000 (15:13 -0400)]
Use an array for signals received instead of a single variable so
we don't lose any when there are multiple different signals.

14 years agoDo signal setup after turning off echo, not before. If we are using
Todd C. Miller [Mon, 10 May 2010 19:02:50 +0000 (15:02 -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).

14 years agoFlush the iobufs on suspend or child exit using the same logic
Todd C. Miller [Fri, 7 May 2010 14:15:25 +0000 (10:15 -0400)]
Flush the iobufs on suspend or child exit using the same logic
as the main event loop.

14 years agoFree memory after we are done with it.
Todd C. Miller [Fri, 7 May 2010 14:14:12 +0000 (10:14 -0400)]
Free memory after we are done with it.

14 years agoQuest now sponsors Sudo development
Todd C. Miller [Thu, 6 May 2010 14:54:21 +0000 (10:54 -0400)]
Quest now sponsors Sudo development

14 years agoInstall sudo_plugin man page.
Todd C. Miller [Wed, 5 May 2010 20:19:02 +0000 (16:19 -0400)]
Install sudo_plugin man page.

14 years agoGo back to reseting io_buffer offset and length (and now also the
Todd C. Miller [Wed, 5 May 2010 20:11:13 +0000 (16:11 -0400)]
Go back to reseting io_buffer offset and length (and now also the
EOF handling) in the loop we do the FD_SET, not after we drain the
buffer after write() since we don't know what order reads and writes
will occur in.

14 years agoaudit files moved to sudoers plugin directory
Todd C. Miller [Wed, 5 May 2010 17:25:29 +0000 (13:25 -0400)]
audit files moved to sudoers plugin directory

14 years agoDocument plugin_printf and new logging functions.
Todd C. Miller [Wed, 5 May 2010 17:22:21 +0000 (13:22 -0400)]
Document plugin_printf and new logging functions.

14 years agoAdd support for logging stdin when it is not a tty.
Todd C. Miller [Wed, 5 May 2010 13:47:12 +0000 (09:47 -0400)]
Add support for logging stdin when it is not a tty.
There is still a bug where "cat | sudo cat" has problems because
both cat and sudo are trying to read from the tty.

14 years agoAdd separate I/O logging functions for tty in/out and stdin/stdout/stderr.
Todd C. Miller [Wed, 5 May 2010 11:29:28 +0000 (07:29 -0400)]
Add separate I/O logging functions for tty in/out and stdin/stdout/stderr.
NOTE: stdin logging does not currently work and is disabled for now.