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.
Todd C. Miller [Sat, 15 Feb 2014 23:04:07 +0000 (16:04 -0700)]
Remove some extraneous markup; from Ingo Schwarze
* No need to explicitly end a macro with No before |
because | counts as middle punctuation
and falls out of the macro, anyway.
* No need to explicitly re-open in-line macros after |
because | counts as middle punctuation
and the macros resume afterwards, anyway.
* Simplify the mnemonic remarks regarding the option letters,
no need for manual font and spacing control with No and Ns.
* Trim Ns No to just Ns, it already implies No.
Todd C. Miller [Tue, 11 Feb 2014 16:40:59 +0000 (09:40 -0700)]
We must include gettext.h before missing.h as it includes system
headers. Also add missing DEFAULT_TEXT_DOMAIN defines in sudoers
audit code that does not include sudoers.h.
Todd C. Miller [Tue, 11 Feb 2014 14:43:13 +0000 (07:43 -0700)]
When emulating DSO_NEXT with shl_get() we need to skip the program's
handle. This used to be documented as being index -2 but now it
seems to be index 0. As this is not guaranteed we need to look up
the real handle value for PROG_HANDLE and skip it when interating
through all the DSOs. Fixes infinite recursion on HP-UX in the
getenv() replacement.
Todd C. Miller [Fri, 7 Feb 2014 21:58:48 +0000 (14:58 -0700)]
Add use_netgroups sudoers option. For LDAP-based sudoers, netgroup
support requires an expensive substring match on the server. If
netgroups are not needed, this option can be disabled to reduce the
load on the LDAP server.
Todd C. Miller [Thu, 6 Feb 2014 22:50:08 +0000 (15:50 -0700)]
Use a default LDAP search filter of (objectClass=sudoRole). When
constructing the netgroup query, add (sudoUser=*) to the query so
we don't fall below the 3 character OpenLDAP substring threshold.
Otherwise the index for sudoUser will never be used for that query.
Pointed out by Michael Stroeder.
Todd C. Miller [Wed, 5 Feb 2014 19:03:58 +0000 (12:03 -0700)]
In term_restore(), only restores the terminal if we are in the
foregroup process group. Instead of calling tcgetpgrp(), which is
racy, we set a temporary handler for SIGTTOU and check whether it
was received after a failed call to tcsetattr().
Todd C. Miller [Tue, 4 Feb 2014 13:22:19 +0000 (06:22 -0700)]
When the closefrom limit is greater than any of the preserved fds,
the pfds list will be non-empty but lastfd will be -1 triggering
an ecalloc(0) assertion. Instead, test for lastfd being -1 and
make sure we always update it, even if dup() fails.
Also restore initial value of lowfd after we are done relocating.
Fixes bug #633
Todd C. Miller [Mon, 3 Feb 2014 23:51:51 +0000 (16:51 -0700)]
syscall restarting is broken on Mac OS X when interrupted by a tty
signal so restart tcsetattr() by hand. For details, see.
http://openradar.appspot.com/radar?id=6402578615107584