Todd C. Miller [Tue, 17 Jun 2014 14:51:41 +0000 (08:51 -0600)]
Don't call gss_krb5_ccache_name() with a NULL pointer when restoring
the old credential cache file name. This can happen if there was
no old name returned by gss_krb5_ccache_name(). Fixes a crash on
kerberized LDAP on some platforms.
Todd C. Miller [Wed, 28 May 2014 15:50:14 +0000 (09:50 -0600)]
Ignore signals sent by the command's process group, not just the
command itself. If we cannot determine the process group ID of the
sender (as it may no longer exist), just check the process ID.
Todd C. Miller [Tue, 27 May 2014 16:51:31 +0000 (10:51 -0600)]
In handler_user_only() only forward the signal if it was not generated
by the command. This should fix a problem with programs that catch
SIGTSTP, perform cleanup, and then re-send the signal to their
process group (of which sudo is the leader).
Todd C. Miller [Mon, 12 May 2014 17:45:17 +0000 (11:45 -0600)]
Do not allow the same callback function to be registered more that
once in fatal_callback_register().
Add fatal_callback_deregister() to deregister a callback.
Todd C. Miller [Fri, 9 May 2014 15:29:42 +0000 (09:29 -0600)]
Don't try to install the temporary sudoers file if we didn't edit it.
By default, visudo does not edit files in a #includedir.
Fixes a NULL pointer defef on GNU hurd; Bug #647
Todd C. Miller [Fri, 2 May 2014 20:57:36 +0000 (14:57 -0600)]
Fix non-blocking mode. We only want to exit the event loop when
poll() or select() returns 0 and there are no active events. This
fixes a problem on some systems where the last buffer was not being
written when the command exited.
Todd C. Miller [Fri, 2 May 2014 13:14:06 +0000 (07:14 -0600)]
Move code to fill in the list of dirs out of switch_dir and into
its own function. Quiets a false positive from cppcheck which got
confused due to variable reuse.
Todd C. Miller [Tue, 15 Apr 2014 13:16:57 +0000 (07:16 -0600)]
Use PAM_REINITIALIZE_CRED instead of PAM_ESTABLISH_CRED when
changing the user. This is the correct flag to use with
a program that changes the uid like su or sudo and fixes a
role problem on Solaris. From Gary Winiger; Bug #642
Todd C. Miller [Wed, 9 Apr 2014 22:31:13 +0000 (16:31 -0600)]
Move the sha2 code into libreplace and add configure checks for
SHA224Update in libc and libmd. Solaris uses "void *" where we use
"unsigned char *" so we need a check for that too. Solaris sha2.h
defines SHA224, SHA256, SHA384, and SHA512 so rename those tokens.
Adapted from changes from Vladimir Marek in bug #641.
Todd C. Miller [Fri, 4 Apr 2014 21:30:15 +0000 (15:30 -0600)]
Forward SIGINFO to running command if supported. If the command
is being run in the background (or exec_background is set in sudoers),
it is the sudo process, not the actual command, that receives the ^T.
Todd C. Miller [Wed, 26 Mar 2014 22:44:29 +0000 (16:44 -0600)]
Make a password/group cache collision a warning rather than fatal.
This should not be possible in practice and we can safely return
the new (potentially duplicate) item as it will be freed by the
caller. Make sudo_set_grlist() return an error on failure instead
of calling fatalx().
Todd C. Miller [Wed, 26 Mar 2014 20:22:46 +0000 (14:22 -0600)]
Use log_warning() instead of log_fatal() if the ticket or lecture
path is too long and just return an error. This can only happen
from a misconfiguration so just ignoring the ticket/lecture file
is safe.
Todd C. Miller [Wed, 26 Mar 2014 20:15:15 +0000 (14:15 -0600)]
In find_path(), return NOT_FOUND_ERROR instead of calling fatal()
if the path is too long. Remove an extraneous check against PATH_MAX
in set_cmnd() since find_path() already contains such a check.
Todd C. Miller [Wed, 26 Mar 2014 19:50:51 +0000 (13:50 -0600)]
Make hexchar() return -1 on invalid input instead of calling fatalx().
Callers used to check that the string was hex before calling hexchar().
Now callers must check for a -1 return value instead.
Todd C. Miller [Wed, 26 Mar 2014 19:00:56 +0000 (13:00 -0600)]
Propagate errors in audit code to caller instead of using fatal().
If we fail to audit an otherwise successful command, return an error
from the policy. For Linux audit, sudo may be compiled with audit
support but auditing may not be setup, so we don't consider that
an error.
Todd C. Miller [Mon, 17 Mar 2014 13:14:55 +0000 (07:14 -0600)]
Don't write an empty timestamp record when timestamp_timeout is
zero. If we find an empty record in the timestamp file, overwrite
it with a good one, truncating the file as needed.
Todd C. Miller [Tue, 11 Mar 2014 15:16:45 +0000 (09:16 -0600)]
The atofoo_test and hltq_test tests now display their own test error rate.
Display pass/fail count separately for sudo_conf and sudo_parseln tests.
Check stderr output for the sudo_conf test.
Todd C. Miller [Fri, 28 Feb 2014 18:05:13 +0000 (11:05 -0700)]
Try -libmldap before -lldap in case there is no link from libibmldap.so
to libldap.so. Since IBM ldap is installed under /opt we should only
be able to reach it if --with-ldap was given an explicit path.
Only check for ber_set_option() if LBER_OPT_DEBUG_LEVEL is defined.