Commit Graph

1548 Commits

Author SHA1 Message Date
Todd C. Miller
a38253b101 Replace use of OSDEFS with config.h defines.
Rename DEFS in Makefile.in to CPPDEFS and include in CPPFLAGS.
Bring back _BSD_SOURCE as a config.h define.
Remove obsolescent _REENTRANT define.
2015-06-18 09:33:05 -06:00
Todd C. Miller
cb63ca701c Avoid using exiting allocators in the front end. 2015-06-17 17:00:54 -06:00
Todd C. Miller
ec7e467c58 Remove asprintf() return value warnings. 2015-06-17 17:00:25 -06:00
Todd C. Miller
f02874fe5b Remove extraneous semicolons in CHECK_* macros. 2015-06-17 10:25:29 -06:00
Todd C. Miller
07f9814450 Remove remaining SUDO_MAIN remnants. 2015-06-17 10:20:14 -06:00
Todd C. Miller
d004b02fc6 Use non-exiting allocatings in the sudoers plugin. 2015-06-17 06:49:59 -06:00
Todd C. Miller
6da04821d7 Use non-exiting allocators in the sudoers SSSD backend. 2015-06-16 15:00:47 -06:00
Todd C. Miller
5413637ae8 Use non-exiting allocators in the sudoers LDAP backend. 2015-06-16 13:58:45 -06:00
Todd C. Miller
ea34d01010 Use \28 and \29 instead of \( and \) in the ldap query as per RFC
2254.  Fixes netgroup queries on AIX.  From Steven Soulen.
2015-06-15 13:32:48 -06:00
Todd C. Miller
25917e435c We need to unlimit RLIMIT_NPROC in sudoers as well as the sudo front
end since set_perms() and restore_perms change the read uid and may
fail with EAGAIN on Linux kernels prior to 3.1.
2015-06-12 15:30:06 -06:00
Todd C. Miller
8eff57f070 Bring back VALIDATE_ERROR which will be used in the case of memory
allocation errors.
2015-06-04 20:42:42 -06:00
Todd C. Miller
7a1cf7f539 Use a stack buffer for the validate_env_vars() error message. 2015-05-28 10:28:38 -06:00
Todd C. Miller
dee7a6ddaf Fix old gcc2 variadic macro support. 2015-05-27 16:38:59 -06:00
Todd C. Miller
21f5753b7d Restore old behavior where visudo prevents you from making the main
sudoers file zero length.
2015-05-27 13:34:28 -06:00
Todd C. Miller
9d1c408b73 Non-exiting allocators for log functions. If log_allowed() fails
the user may not run the command.  We don't try to return early for
log_failure(), log_auth_failure() or log_denial() as we would not
run the command in that case.
2015-05-27 10:55:27 -06:00
Todd C. Miller
4da9e10971 Use non-exiting allocators in the parser (much of it already did). 2015-05-27 10:36:03 -06:00
Todd C. Miller
6b7be032af Use non-existing allocators in the passwd/group cache functions. 2015-05-27 10:26:49 -06:00
Todd C. Miller
2bf454b74d Use non-exiting allocators in the redblack tree and fix the fallout.
Also switch to non-exiting allocators in affected code blocks.
2015-05-27 09:51:54 -06:00
Todd C. Miller
46770c9588 The error string returned by alias_add should be const. 2015-05-27 09:48:34 -06:00
Todd C. Miller
c5e4c3055a Fix typo, efree vs. free. 2015-05-27 09:48:31 -06:00
Todd C. Miller
4131449ffb Add a few missing sudo_new_key_val() return value checks.
Also use non-exiting allocators for consistency.
2015-05-27 09:42:51 -06:00
Todd C. Miller
8d1708434f Add sudo_strsplit(), similar to strtok_r() but non-destructive and
operates on non-C strings (requires a length parameter).
2015-05-26 15:46:41 -06:00
Todd C. Miller
69e62f316e Use reallocarray() instead of sudo_emallocarray() and return an
error on allocation failure.
2015-05-20 10:59:03 -06:00
Todd C. Miller
212ff5d964 In our krb5_get_init_creds_opt_alloc() replacement use malloc()
instead of sudo_emalloc() and return KRB5_CC_NOMEM on allocation
failure.  Only old versions of Kerberos V will need this.
2015-05-20 10:58:17 -06:00
Todd C. Miller
04128f5985 Get rid of SUDO_MAIN. Modern compilers don't warn about mixing
extern and auto declarations unless they conflict.
2015-05-21 11:26:44 -06:00
Todd C. Miller
05a01d4c5d Avoid using a leading underbar in defines as they are reserved in
ISO C.
2015-05-21 11:13:20 -06:00
Todd C. Miller
1298ea9107 Add target for "make splint". A few files need extra guards to avoid
errors on systems where they would not otherwise be compiled.
No warnings from splint.
2015-05-21 11:07:13 -06:00
Todd C. Miller
cbcaaa299a No need to cast malloc() return value. 2015-05-14 10:47:09 -06:00
Todd C. Miller
c75eb5bf0d Use reallocarray where possible. 2015-05-14 10:21:58 -06:00
Todd C. Miller
8bc70a635c Instead of trying to make weak functions work on all platforms,
just use a registration function for a plugin-specific setlocale
function.  The sudoers version just wraps sudoers_setlocale().
2015-05-11 14:51:32 -06:00
Todd C. Miller
c80b9c9457 In usergr_matches() matched should be bool but we have to take care
to handle group_plugin_query() returning a value other than 0/1.
2015-05-07 10:56:12 -06:00
Todd C. Miller
d16434f977 sudo_ldap_check_non_unix_group() returns bool, not int. 2015-05-07 10:43:26 -06:00
Todd C. Miller
eea4e1afd9 Convert two debug_return_int to debug_return_bool. 2015-05-07 10:40:46 -06:00
Todd C. Miller
caf5d45e0f Previously, debug_return_bool was the same as debug_return_int
except that it logged true/false for 1/0.  However, this appears
to trigger a bug in some compilers.  To avoid this, debug_return_bool
now uses bool, not int.  Callers that were passing it an int have
been converted to use debug_return_int instead.
2015-05-07 10:33:23 -06:00
Todd C. Miller
ff89dde116 Sync with translationproject.org 2015-04-27 14:12:11 -06:00
Todd C. Miller
8930db0e09 Only fall back on AUE_DARWIN_sudo if au_preselect() fails. 2015-04-26 07:55:33 -06:00
Todd C. Miller
8a18383644 Work around a problem on Mac OS X 10.10 which defines AUE_sudo but
where au_preselect() only accepts AUE_DARWIN_sudo (the old value).
2015-04-25 19:44:52 -06:00
Todd C. Miller
e98778b2a2 When creating a passwd struct from a uid that is not in the passwd
database, set pw_gid to the user's gid instead of whatever the user
specified via the -g flag (or 0 if no -g).
2015-04-16 13:19:04 -06:00
Todd C. Miller
3de14196c8 Add some ldap_err2string() debugging when the LDAP search fails.
Adapted from a diff from Steven Soulen.
2015-04-14 09:50:40 -06:00
Todd C. Miller
db74048989 Sync with translationproject.org 2015-04-13 14:04:49 -06:00
Todd C. Miller
a79f3790ee Add sys/types.h 2015-04-09 11:01:41 -06:00
Todd C. Miller
eeca3b0ca4 Include sys/types.h instead of unistd.h to get uid_t and gid_t.
Add missing include of sys/types.h to a few places.
2015-04-09 10:58:04 -06:00
Todd C. Miller
15037d3b7e Make libsudo_util depend on libintl instead of requiring users of
libsudo_util to link with libintl directly.  Bug #690
2015-03-22 08:16:22 -06:00
Todd C. Miller
3b30984406 Use saved errno in vlog_warning() before calling sudo_vwarn_nodebug().
Fixes the error message printed if set_perms() fails.
2015-03-21 15:41:59 -06:00
Todd C. Miller
be4872f691 For sudoedit, run the editor with the user's original environment
as per the documentation (and as in sudo 1.7.x).  Bug #688
2015-03-16 20:19:24 -06:00
Todd C. Miller
d8d6fae793 Sync with translationproject.org 2015-03-16 14:11:19 -06:00
Todd C. Miller
0600a0d0a9 Sync with translationproject.org 2015-03-09 11:16:09 -06:00
Todd C. Miller
9896b2243d Sync with translationproject.org 2015-03-05 12:28:51 -07:00
Todd C. Miller
ee72cba937 Use futimens() and utimensat() instead of futimes() and utimes(). 2015-03-02 13:58:50 -07:00
Todd C. Miller
ea514dc391 Fix compiler warning on systems where mode_t is not unsigned int,
such as 32-bit Solaris.
2015-03-02 13:58:45 -07:00