Todd C. Miller [Wed, 21 Jan 2004 23:00:43 +0000 (23:00 +0000)]
Add a new flag, -e, that makes it possible to give users the ability
to edit files with the editor of their choice as the invoking user,
not the runas user. Temporary files are used for the actual edit
and the temp file is copied over the original after the editor is done.
Todd C. Miller [Wed, 21 Jan 2004 22:25:10 +0000 (22:25 +0000)]
Add a new flag, -e, that makes it possible to give users the ability
to edit files with the editor of their choice as the invoking user,
not the runas user. Temporary files are used for the actual edit
and the temp file is copied over the original after the editor is done.
Todd C. Miller [Wed, 21 Jan 2004 22:06:02 +0000 (22:06 +0000)]
If real uid == 0 and the SUDO_USER environment variables is set,
use that to determine the invoking user's true identity. That way
the proper info gets logged by someone who has done "sudo su" but
still uses sudo to as root. We can't do this for non-root users
since that would open up a security hole, though perhaps it would
be acceptable to use getlogin(2) on OSes where this a system call
(and doesn't just look in the utmp file).
Todd C. Miller [Tue, 20 Jan 2004 19:22:46 +0000 (19:22 +0000)]
Back out portions of the -i commit that set NewArgv[0] in set_runaspw.
It is far to late to set NewArgv[0] there and will have no effect
anyway as cmnd and safe_cmnd have already been set.
Todd C. Miller [Fri, 9 Jan 2004 08:29:33 +0000 (08:29 +0000)]
o merge the hpux case entries into a single entry w/ its own sub-case statement.
o HP-UX >= 11 support getspnam(), use it in preference to getprpwuid()
Todd C. Miller [Fri, 9 Jan 2004 06:15:34 +0000 (06:15 +0000)]
o No need to check for sed, libtool config does that for us
o move check for --with-noexec until after libtool magic is run so we
can use $can_build_shared and $shrext
Todd C. Miller [Mon, 5 Jan 2004 02:48:09 +0000 (02:48 +0000)]
Add support for preloading a shared object containing a dummy execve()
function that just sets error and returns -1. This adds a
"noexec_file" option to load the filename as well as a "noexec" flag
to enable it unconditionally. There is also a NOEXEC tag that can
be attached to specific commands and an EXEC tag to disable it.
Todd C. Miller [Tue, 30 Dec 2003 22:31:30 +0000 (22:31 +0000)]
Add support for tuples in def_data.in; these are implemented as an
enum type. Currently there is only a single tuple enum but in the
future we may have one tuple enum per T_TUPLE entry in def_data.in.
Currently listpw, verifypw and lecture are tuples. This avoids the
need to have two entries (one ival, one str) for pwflags and syslog
values.
lecture is now a tuple with the following values: never, once, always
We no longer use both an int and string entry for syslog facilities
and priorities. Instead, there are logfac2str() and logpri2str()
functions that get used when we need to print the string values.
Todd C. Miller [Tue, 30 Dec 2003 22:20:21 +0000 (22:20 +0000)]
Create def_* macros for each defaults value so we no longer need
the def_{flag,ival,str,list,mode} macros (which have been removed).
This is a step toward more flexible data types in def_data.in.
Todd C. Miller [Tue, 23 Dec 2003 02:18:13 +0000 (02:18 +0000)]
If we are in -k/-K mode, just spew to stderr. It is not unusual for
users to place "sudo -k" in a .logout file which can cause sudo to
be run during reboot after the YP/NIS/NIS+/LDAP/etc daemon has died.
Previously, this would result in useless mail and logging.
Todd C. Miller [Sun, 29 Jun 2003 01:31:55 +0000 (01:31 +0000)]
Fix a core dump on Solaris by preserving the pam_handle_t we used
during authentication for pam_prep_user(). If we didn't authenticate
(ie: ticket still valid), we call pam_init() from pam_prep_user().
This is something of a hack; it may be better to change the auth
API and add an auth_final() function that acts like pam_prep_user().
Todd C. Miller [Mon, 9 Jun 2003 20:07:56 +0000 (20:07 +0000)]
Also exit waitpid() loop when pid == 0. Fixes a problem where the sudo
process would spin eating up CPU until sendmail finished when it has
to send mail.
Todd C. Miller [Thu, 22 May 2003 01:53:01 +0000 (01:53 +0000)]
Don't assume that getgrnam() calls don't modify contents of
struct passwd returned by getpwnam(). On FreeBSD w/ NIS this
can happen. Based on a patch from Kirk Webb.