Todd C. Miller [Thu, 27 May 2004 19:55:06 +0000 (19:55 +0000)]
In sudoers_lookup() return VALIDATE_NOT_OK if the runas user was
explicitly denied and the command matched. This fixes a long-standing
bug and makes:
foo machine = (ALL) /usr/bin/blah
foo machine = (!bar) /usr/bin/blah
equivalent to:
foo machine = (ALL, !bar) /usr/bin/blah
Todd C. Miller [Mon, 17 May 2004 20:28:54 +0000 (20:28 +0000)]
No longer use /tmp/.odus as a possible timestamp dir unless specifically
configured to do so. Instead, if no /var/run exists, use /var/adm/sudo
or /usr/adm/sudo.
Todd C. Miller [Mon, 17 May 2004 20:28:53 +0000 (20:28 +0000)]
No longer use /tmp/.odus as a possible timestamp dir unless specifically
configured to do so. Instead, if no /var/run exists, use /var/adm/sudo
or /usr/adm/sudo.
Todd C. Miller [Mon, 17 May 2004 20:28:53 +0000 (20:28 +0000)]
No longer use /tmp/.odus as a possible timestamp dir unless specifically
configured to do so. Instead, if no /var/run exists, use /var/adm/sudo
or /usr/adm/sudo.
Todd C. Miller [Mon, 17 May 2004 20:28:53 +0000 (20:28 +0000)]
No longer use /tmp/.odus as a possible timestamp dir unless specifically
configured to do so. Instead, if no /var/run exists, use /var/adm/sudo
or /usr/adm/sudo.
Todd C. Miller [Mon, 5 Apr 2004 00:27:05 +0000 (00:27 +0000)]
In Exit() when used as a signal handler, emsg is a pointer so
sizeof() is wrong so make it a #define instead. Also avoid using
a negative exit value. Found by Aaron Campbell
Todd C. Miller [Thu, 29 Jan 2004 21:15:27 +0000 (21:15 +0000)]
Don't look at prev_user until after we've parsed sudoers and done the
password check. That way, if sudo/sudoedit is run from a root process
that was invoked by sudo, we check sudoers for root, not the previous
user. This makes sudoedit much more useful and means that for the
sudo case, we get correct logging on who actually ran the command.
Todd C. Miller [Thu, 22 Jan 2004 17:14:18 +0000 (17:14 +0000)]
Alas, all the world does not go through execve(2). Many systems
still have an execv(2) system call, Linux 2.6 provides fexecve(2)
and it is not uncommon for libc to have underscore ('_') versions
of the functions to be used internally by the library. Instead of
stubbing all these out by hand, define a macro and let it do the
work. Extra exec functions pointed out by Reznic Valery.
Todd C. Miller [Thu, 22 Jan 2004 02:57:01 +0000 (02:57 +0000)]
Fix suspending the editor in -e mode. Because we do a fork() first
we need to be notified when the child has been stopped and then send
that same signal to ourself so the shell can do its job control thing.
Todd C. Miller [Thu, 22 Jan 2004 02:44:13 +0000 (02:44 +0000)]
Use WIFEXITED and WEXITSTATUS macros. If there are systems out there
that want to run sudo that still don't support these we can try to
deal with that later.
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.