Commit Graph

7549 Commits

Author SHA1 Message Date
Todd C. Miller
134b2a4228 Rename emalloc2() -> emallocarray() and erealloc3() -> ereallocarray(). 2014-04-22 16:02:28 -06:00
Todd C. Miller
28b564daab Add missing rule for building sha2.lo when not supported by libc or libmd. 2014-04-22 09:18:43 -06:00
Todd C. Miller
b4262391e9 Disable I/O logging for halt and poweroff in addition to reboot in
commented out example.
2014-04-15 11:26:01 -06:00
Todd C. Miller
7d91691e1f 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
2014-04-15 07:16:57 -06:00
Todd C. Miller
278a8ba391 pam_setcred should default to true; from Gary Winiger
Bug #642
2014-04-15 07:11:29 -06:00
Todd C. Miller
a78da37487 Make set_perms() and restore_perms() return an error instead of
calling exit() on failure.
2014-04-10 16:11:47 -06:00
Todd C. Miller
40375a6268 Eliminate calls to fatal() in sudoers.c and just pass back a return
value.
2014-04-10 16:03:26 -06:00
Todd C. Miller
a48c00dc31 Elimate calls to fatal() in the logging code. 2014-04-10 16:03:01 -06:00
Todd C. Miller
db831ace32 Quiet a compiler warning on Solaris. 2014-04-09 16:33:28 -06:00
Todd C. Miller
218aa1e598 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.
2014-04-09 16:31:13 -06:00
Todd C. Miller
27aff732f1 Fix matching of uids and gids broken in sudo 1.8.9. 2014-04-09 10:22:09 -06:00
Todd C. Miller
ecae6b4f9a Fix -P option in usage() 2014-04-09 10:22:07 -06:00
Todd C. Miller
b1cdb3708c Remove a few more unnecessary uses of fatal(). 2014-04-07 19:52:28 -06:00
Todd C. Miller
d702ee9813 Use log_warning() not log_fatal() for the "Invalid authentication
methods compiled into sudo" message.  We return -1 on error anyway.
2014-04-07 08:59:48 -06:00
Todd C. Miller
2a290f812e Return MODE_ERROR from sudoers_policy_deserialize_info() instead
of calling fatalx().
2014-04-07 05:34:56 -06:00
Todd C. Miller
ac3ffde5e8 parse_gid_list() now returns -1 on error instead of calling fatalx(). 2014-04-07 05:33:36 -06:00
Todd C. Miller
36b991348c 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.
2014-04-04 15:30:15 -06:00
Todd C. Miller
9b7dfa7522 Remove calls to log_fatal() in I/O log functions and just pass an
error back to the caller.
2014-04-04 15:30:12 -06:00
Todd C. Miller
6a295400b7 Make "internal error, %s overflow" arguments consistent, using
__func__ where possible (when debugging is allowed).
2014-04-01 16:42:13 -06:00
Todd C. Miller
a1240a5417 Use common printf format when warning of buffer overflow prevention. 2014-03-31 15:58:24 -06:00
Todd C. Miller
e0415632e2 Remove init.d/*.sh in distclean 2014-03-31 15:47:02 -06:00
Todd C. Miller
275b2edbd6 Correctly ignore init.d/*.sh 2014-03-31 15:46:47 -06:00
Todd C. Miller
7d994b5032 Remove remaining calls to fatalx(); just pass the error to the caller. 2014-03-31 15:43:52 -06:00
Todd C. Miller
2d1484fe84 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().
2014-03-26 16:44:29 -06:00
Todd C. Miller
db54815996 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.
2014-03-26 14:22:46 -06:00
Todd C. Miller
639ac92e6d 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.
2014-03-26 14:15:15 -06:00
Todd C. Miller
4848b5691d Remove unused MODE_LISTDEFS define and correct a comment. 2014-03-26 14:03:04 -06:00
Todd C. Miller
9ff3b1b570 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.
2014-03-26 13:50:51 -06:00
Todd C. Miller
2220f55aef 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.
2014-03-26 13:00:56 -06:00
Todd C. Miller
7d7f9cb55a Remove unused variable on Linux. 2014-03-26 11:10:20 -06:00
Todd C. Miller
2dfc10830c Fix warning on systems where mode_t is not unsigned int (Solaris). 2014-03-26 11:09:57 -06:00
Todd C. Miller
1017ad4e2c Audit path too long errror. Add comments about non-audit events
and placeholders for future audit hooks.
2014-03-25 16:46:00 -06:00
Todd C. Miller
4e3e5077e1 Remove unused FLAG_USER auth flag. We have no auth methods that
require that authentication be run as the invoking user.
2014-02-27 15:51:40 -07:00
Todd C. Miller
6a7ebd280b Fix aliasing warning in old-style interface probe code. 2014-03-25 16:16:19 -06:00
Todd C. Miller
a5aeaf20da Fix some sign comparision warnings. 2014-03-25 16:16:11 -06:00
Todd C. Miller
250e8e750c Don't call fatal/fatalx in common/*.c 2014-03-25 16:16:10 -06:00
Todd C. Miller
3cdb944de4 Fix expansion of %p in the prompt for "sudo -l" when rootpw, runaspw
or targetpw is set.  Bug #639
2014-03-19 16:55:37 -06:00
Todd C. Miller
122257e095 Sudo 1.8.10p2 2014-03-17 08:09:39 -06:00
Todd C. Miller
4d712aa903 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.
2014-03-17 07:14:55 -06:00
Todd C. Miller
60cf68ad16 Fix typos in description of the -x option. Bug #637 2014-03-15 09:15:36 -06:00
Todd C. Miller
01cf646a77 Sudo 1.8.10p1 2014-03-13 14:41:36 -06:00
Todd C. Miller
403a48da40 Fix typo/thinko that prevented "Defaults !tty_tickets" from working. 2014-03-13 13:38:42 -06:00
Todd C. Miller
35c41deb41 Fix "sudo -l command" output when the matching command is negated.
Bug #636
2014-03-13 08:21:04 -06:00
Todd C. Miller
967fda0fbc 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.
2014-03-11 09:16:45 -06:00
Todd C. Miller
f12a546a5e Don't run the check_ttyname test if cross compiling. 2014-03-11 09:16:21 -06:00
Todd C. Miller
5c6d2ad689 CWD no longer used. 2014-03-11 09:00:48 -06:00
Todd C. Miller
ee135ea261 Fix diff of toke and err output files in "make check" 2014-03-11 08:52:52 -06:00
Todd C. Miller
7dec05d7d4 sync with translationproject.org 2014-03-07 14:48:13 -07:00
Todd C. Miller
0cf7f404a4 Check whether ber.h is needed before ldap.h even if we are not using
any ber functions.  Needed for older versions of nss ldap.
2014-03-06 15:26:09 -07:00
Todd C. Miller
8461dc6e24 Fix compiler warning in debug code. 2014-03-06 15:21:49 -07:00