]> granicus.if.org Git - sudo/log
sudo
9 years agodisplay_privs() and display_cmnd() may need to return -1 on error.
Todd C. Miller [Fri, 26 Jun 2015 16:33:28 +0000 (10:33 -0600)]
display_privs() and display_cmnd() may need to return -1 on error.

9 years agoReturn -1, not 0 from sudoers when there is an error (as opposed to
Todd C. Miller [Thu, 25 Jun 2015 17:12:36 +0000 (11:12 -0600)]
Return -1, not 0 from sudoers when there is an error (as opposed to
a policy denial).

9 years agoCheck restore_perms() return value in all cases, pushing the
Todd C. Miller [Thu, 25 Jun 2015 17:12:36 +0000 (11:12 -0600)]
Check restore_perms() return value in all cases, pushing the
return value back up the call stack.

9 years agoAdd Joel Pelaez Jorge
Todd C. Miller [Thu, 25 Jun 2015 15:16:07 +0000 (09:16 -0600)]
Add Joel Pelaez Jorge

9 years agoWhen checking whether the PAM prompt matches "Password:", also check
Todd C. Miller [Thu, 25 Jun 2015 15:12:15 +0000 (09:12 -0600)]
When checking whether the PAM prompt matches "Password:", also check
for the untranslated version.  The PAM module might not be using the
localized string even though it exists.  From Joel Pelaez Jorge.
Fixes Bug #701

9 years agoSilence clang analyzer warning on glibc systems where the first
Todd C. Miller [Wed, 24 Jun 2015 16:32:08 +0000 (10:32 -0600)]
Silence clang analyzer warning on glibc systems where the first
argument to qsort() is marked as non-NULL.
Also change some counters from into to unsigned int and two flags
from int to bool.

9 years agoSilence clang analyzer warning on glibc systems where the first
Todd C. Miller [Tue, 23 Jun 2015 22:37:01 +0000 (16:37 -0600)]
Silence clang analyzer warning on glibc systems where the first
argument to qsort() is marked as non-NULL.

9 years agoUse our own bitmap macros instead of borrowing the ones from select.
Todd C. Miller [Tue, 23 Jun 2015 22:37:00 +0000 (16:37 -0600)]
Use our own bitmap macros instead of borrowing the ones from select.

9 years agoQuiet clang analyzer false positive.
Todd C. Miller [Tue, 23 Jun 2015 18:58:02 +0000 (12:58 -0600)]
Quiet clang analyzer false positive.

9 years agoFix uninitialized variables warnings in error case when src file
Todd C. Miller [Tue, 23 Jun 2015 18:57:47 +0000 (12:57 -0600)]
Fix uninitialized variables warnings in error case when src file
cannot be opened.  At least one of these is a false positive.

9 years agoMust call round_nfds() with fd+1 since it takes a count not the fd
Todd C. Miller [Tue, 23 Jun 2015 19:49:56 +0000 (13:49 -0600)]
Must call round_nfds() with fd+1 since it takes a count not the fd
number.  In other words, the lowest value is 1, not 0.

9 years agoIt's safe to rely on C89 semantics for realloc(NULL, size).
Todd C. Miller [Sun, 21 Jun 2015 01:27:31 +0000 (19:27 -0600)]
It's safe to rely on C89 semantics for realloc(NULL, size).

9 years agomalloc() sets errno to ENOMEM on failure so we don't need to set
Todd C. Miller [Sun, 21 Jun 2015 01:26:43 +0000 (19:26 -0600)]
malloc() sets errno to ENOMEM on failure so we don't need to set
it explicitly.

9 years agoNo longer need __malloc_like
Todd C. Miller [Sat, 20 Jun 2015 22:56:57 +0000 (16:56 -0600)]
No longer need __malloc_like

9 years agoRemove symbols from the now-removed alloc.c.
Todd C. Miller [Sat, 20 Jun 2015 22:56:42 +0000 (16:56 -0600)]
Remove symbols from the now-removed alloc.c.

9 years agoOnly include stddef.h where it is needed.
Todd C. Miller [Sat, 20 Jun 2015 11:34:35 +0000 (05:34 -0600)]
Only include stddef.h where it is needed.

9 years agoregen
Todd C. Miller [Fri, 19 Jun 2015 22:50:54 +0000 (16:50 -0600)]
regen

9 years agoBetter handling of setlocale() returning NULL.
Todd C. Miller [Fri, 19 Jun 2015 22:49:02 +0000 (16:49 -0600)]
Better handling of setlocale() returning NULL.

9 years agoAdd function name to "unable to allocate memory" warnings.
Todd C. Miller [Fri, 19 Jun 2015 20:51:17 +0000 (14:51 -0600)]
Add function name to "unable to allocate memory" warnings.

9 years agoWe require ANSI C so stop using the obsolete STDC_HEADERS.
Todd C. Miller [Fri, 19 Jun 2015 20:29:27 +0000 (14:29 -0600)]
We require ANSI C so stop using the obsolete STDC_HEADERS.

9 years agoAdd back _REENTRANT define on HP-UX to expose strtok_r on some versions.
Todd C. Miller [Fri, 19 Jun 2015 18:35:51 +0000 (12:35 -0600)]
Add back _REENTRANT define on HP-UX to expose strtok_r on some versions.
We may need to define it on other systems too.

9 years agoUse strtok_r() instead of strtok()
Todd C. Miller [Fri, 19 Jun 2015 18:35:51 +0000 (12:35 -0600)]
Use strtok_r() instead of strtok()

9 years agoFix check for strnlen() when cross-compiling.
Todd C. Miller [Fri, 19 Jun 2015 15:54:12 +0000 (09:54 -0600)]
Fix check for strnlen() when cross-compiling.

9 years agoUse sudo_strsplit() in dump_interfaces.
Todd C. Miller [Fri, 19 Jun 2015 14:57:54 +0000 (08:57 -0600)]
Use sudo_strsplit() in dump_interfaces.

9 years agoRemove obsolete memory.h include.
Todd C. Miller [Fri, 19 Jun 2015 03:02:57 +0000 (21:02 -0600)]
Remove obsolete memory.h include.

9 years agoRemove support for the obsolete malloc.h header.
Todd C. Miller [Fri, 19 Jun 2015 02:30:59 +0000 (20:30 -0600)]
Remove support for the obsolete malloc.h header.

9 years agoRemove BROKEN_SYSLOG define which was for obsolete versions of HP-UX.
Todd C. Miller [Thu, 18 Jun 2015 23:53:49 +0000 (17:53 -0600)]
Remove BROKEN_SYSLOG define which was for obsolete versions of HP-UX.
Remove last remnants of 4.2BSD syslog support.

9 years agoUse sudo_strsplit() instead of doing the equivalent manually.
Todd C. Miller [Thu, 18 Jun 2015 22:14:49 +0000 (16:14 -0600)]
Use sudo_strsplit() instead of doing the equivalent manually.

9 years agoTest strsplit behavior with an empty string.
Todd C. Miller [Thu, 18 Jun 2015 22:14:20 +0000 (16:14 -0600)]
Test strsplit behavior with an empty string.

9 years agoAllow "make LIBTOOL=/path/to/libtool" to work properly.
Todd C. Miller [Thu, 18 Jun 2015 19:06:15 +0000 (13:06 -0600)]
Allow "make LIBTOOL=/path/to/libtool" to work properly.

9 years agoUse a common function for resolviong the user's editor in sudoedit
Todd C. Miller [Thu, 18 Jun 2015 15:51:36 +0000 (09:51 -0600)]
Use a common function for resolviong the user's editor in sudoedit
and visudo.  The find_path() function now returns a dynamically
allocated path instead of using a static string.

9 years agoReplace use of OSDEFS with config.h defines.
Todd C. Miller [Thu, 18 Jun 2015 15:33:05 +0000 (09:33 -0600)]
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.

9 years agoRemove now-unused sudo_alloc.h and alloc.c
Todd C. Miller [Wed, 17 Jun 2015 23:00:55 +0000 (17:00 -0600)]
Remove now-unused sudo_alloc.h and alloc.c

9 years agoAvoid using exiting allocators in the front end.
Todd C. Miller [Wed, 17 Jun 2015 23:00:54 +0000 (17:00 -0600)]
Avoid using exiting allocators in the front end.

9 years agoUse non-exiting allocators in libsudo_util.
Todd C. Miller [Wed, 17 Jun 2015 23:00:53 +0000 (17:00 -0600)]
Use non-exiting allocators in libsudo_util.

9 years agoRemove asprintf() return value warnings.
Todd C. Miller [Wed, 17 Jun 2015 23:00:25 +0000 (17:00 -0600)]
Remove asprintf() return value warnings.

9 years agoUse AC_FUNC_STRNLEN to check for broken strnlen() on AIX.
Todd C. Miller [Wed, 17 Jun 2015 23:00:21 +0000 (17:00 -0600)]
Use AC_FUNC_STRNLEN to check for broken strnlen() on AIX.
This requires that we use AC_USE_SYSTEM_EXTENSIONS so remove
things from OSDEFS that are enabled by AC_USE_SYSTEM_EXTENSIONS.

9 years agoRemove extraneous semicolons in CHECK_* macros.
Todd C. Miller [Wed, 17 Jun 2015 16:25:29 +0000 (10:25 -0600)]
Remove extraneous semicolons in CHECK_* macros.

9 years agoRemove remaining SUDO_MAIN remnants.
Todd C. Miller [Wed, 17 Jun 2015 16:20:14 +0000 (10:20 -0600)]
Remove remaining SUDO_MAIN remnants.

9 years agoUse non-exiting allocatings in the sudoers plugin.
Todd C. Miller [Wed, 17 Jun 2015 12:49:59 +0000 (06:49 -0600)]
Use non-exiting allocatings in the sudoers plugin.

9 years agoUse non-exiting allocators in the sudoers SSSD backend.
Todd C. Miller [Tue, 16 Jun 2015 21:00:47 +0000 (15:00 -0600)]
Use non-exiting allocators in the sudoers SSSD backend.

9 years agoUse non-exiting allocators in the sudoers LDAP backend.
Todd C. Miller [Tue, 16 Jun 2015 19:58:45 +0000 (13:58 -0600)]
Use non-exiting allocators in the sudoers LDAP backend.

9 years agoregen dependencies
Todd C. Miller [Tue, 16 Jun 2015 19:17:46 +0000 (13:17 -0600)]
regen dependencies

9 years agoAdd missing dependency info for reallocarray.lo in lib/util/Makefile.in
Todd C. Miller [Mon, 15 Jun 2015 19:45:12 +0000 (13:45 -0600)]
Add missing dependency info for reallocarray.lo in lib/util/Makefile.in
and regen configure to match last configure.ac change.

9 years agoUse \28 and \29 instead of \( and \) in the ldap query as per RFC
Todd C. Miller [Mon, 15 Jun 2015 19:32:48 +0000 (13:32 -0600)]
Use \28 and \29 instead of \( and \) in the ldap query as per RFC
2254.  Fixes netgroup queries on AIX.  From Steven Soulen.

9 years agoMove pattern length check until after we have initialized the glob_t
Todd C. Miller [Sat, 13 Jun 2015 14:13:48 +0000 (08:13 -0600)]
Move pattern length check until after we have initialized the glob_t
so we can call globfree() even on error.  From Frank Denis.

9 years agoWe need to unlimit RLIMIT_NPROC in sudoers as well as the sudo front
Todd C. Miller [Fri, 12 Jun 2015 21:30:06 +0000 (15:30 -0600)]
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.

9 years agoFix underlining of "root" in -u option descriptions. Bug #699
Todd C. Miller [Mon, 8 Jun 2015 22:49:09 +0000 (16:49 -0600)]
Fix underlining of "root" in -u option descriptions.  Bug #699

9 years agoRemove support for converting plugin.so -> plugin.sl on HP-UX when
Todd C. Miller [Mon, 8 Jun 2015 19:57:14 +0000 (13:57 -0600)]
Remove support for converting plugin.so -> plugin.sl on HP-UX when
plugin.so can not be found.  This was a temporary hack for using
an older (pre 1.8.7) sudoers plugin with a newer sudo front-end.

9 years agoAdd debugging output on memory alloc failure.
Todd C. Miller [Fri, 5 Jun 2015 19:18:48 +0000 (13:18 -0600)]
Add debugging output on memory alloc failure.
Add missing checks in event_select.c for reallocarray() failure.

9 years agoUse non-exiting allocators.
Todd C. Miller [Fri, 5 Jun 2015 19:17:56 +0000 (13:17 -0600)]
Use non-exiting allocators.

9 years agoBring back VALIDATE_ERROR which will be used in the case of memory
Todd C. Miller [Fri, 5 Jun 2015 02:42:42 +0000 (20:42 -0600)]
Bring back VALIDATE_ERROR which will be used in the case of memory
allocation errors.

9 years agoIf asprintf() or vasprintf() fail, set the dest pointer to NULL
Todd C. Miller [Wed, 3 Jun 2015 17:07:56 +0000 (11:07 -0600)]
If asprintf() or vasprintf() fail, set the dest pointer to NULL
like BSD and Solaris do.  This appears to be the direction glibc
is going as well.

10 years agoUse a stack buffer for the validate_env_vars() error message.
Todd C. Miller [Thu, 28 May 2015 16:28:38 +0000 (10:28 -0600)]
Use a stack buffer for the validate_env_vars() error message.

10 years agoFix typo/thinko in static buffer conversion; use vsnprintf() not snprintf()
Todd C. Miller [Wed, 27 May 2015 22:41:46 +0000 (16:41 -0600)]
Fix typo/thinko in static buffer conversion; use vsnprintf() not snprintf()

10 years agoFix old gcc2 variadic macro support.
Todd C. Miller [Wed, 27 May 2015 22:38:59 +0000 (16:38 -0600)]
Fix old gcc2 variadic macro support.

10 years agoRestore old behavior where visudo prevents you from making the main
Todd C. Miller [Wed, 27 May 2015 19:34:28 +0000 (13:34 -0600)]
Restore old behavior where visudo prevents you from making the main
sudoers file zero length.

10 years agoNon-exiting allocators for log functions. If log_allowed() fails
Todd C. Miller [Wed, 27 May 2015 16:55:27 +0000 (10:55 -0600)]
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.

10 years agoUse non-exiting allocators in the parser (much of it already did).
Todd C. Miller [Wed, 27 May 2015 16:36:03 +0000 (10:36 -0600)]
Use non-exiting allocators in the parser (much of it already did).

10 years agoUse non-existing allocators in the passwd/group cache functions.
Todd C. Miller [Wed, 27 May 2015 16:26:49 +0000 (10:26 -0600)]
Use non-existing allocators in the passwd/group cache functions.

10 years agoAdd standalone reallocarray.c from OpenBSD instead of rolling our own.
Todd C. Miller [Wed, 27 May 2015 16:04:32 +0000 (10:04 -0600)]
Add standalone reallocarray.c from OpenBSD instead of rolling our own.

10 years agoUse non-exiting allocators in the redblack tree and fix the fallout.
Todd C. Miller [Wed, 27 May 2015 15:51:54 +0000 (09:51 -0600)]
Use non-exiting allocators in the redblack tree and fix the fallout.
Also switch to non-exiting allocators in affected code blocks.

10 years agoThe error string returned by alias_add should be const.
Todd C. Miller [Wed, 27 May 2015 15:48:34 +0000 (09:48 -0600)]
The error string returned by alias_add should be const.

10 years agoFix typo, efree vs. free.
Todd C. Miller [Wed, 27 May 2015 15:48:31 +0000 (09:48 -0600)]
Fix typo, efree vs. free.

10 years agoAdd a few missing sudo_new_key_val() return value checks.
Todd C. Miller [Wed, 27 May 2015 15:42:51 +0000 (09:42 -0600)]
Add a few missing sudo_new_key_val() return value checks.
Also use non-exiting allocators for consistency.

10 years agoAdd unit tests for strsplit and parse_gid_list.
Todd C. Miller [Wed, 27 May 2015 02:25:08 +0000 (20:25 -0600)]
Add unit tests for strsplit and parse_gid_list.

10 years agoAdd sudo_strsplit(), similar to strtok_r() but non-destructive and
Todd C. Miller [Tue, 26 May 2015 21:46:41 +0000 (15:46 -0600)]
Add sudo_strsplit(), similar to strtok_r() but non-destructive and
operates on non-C strings (requires a length parameter).

10 years agoUse reallocarray() instead of sudo_emallocarray() and return an
Todd C. Miller [Wed, 20 May 2015 16:59:03 +0000 (10:59 -0600)]
Use reallocarray() instead of sudo_emallocarray() and return an
error on allocation failure.

10 years agoIn our krb5_get_init_creds_opt_alloc() replacement use malloc()
Todd C. Miller [Wed, 20 May 2015 16:58:17 +0000 (10:58 -0600)]
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.

10 years agoUse non-exiting allocators.
Todd C. Miller [Wed, 20 May 2015 16:39:08 +0000 (10:39 -0600)]
Use non-exiting allocators.

10 years agoUse a static buffer for sudo_warn/sudo_fatal messages where possible.
Todd C. Miller [Tue, 26 May 2015 21:24:54 +0000 (15:24 -0600)]
Use a static buffer for sudo_warn/sudo_fatal messages where possible.

10 years agoFix sudo_strnlen() prototype.
Todd C. Miller [Tue, 26 May 2015 20:14:06 +0000 (14:14 -0600)]
Fix sudo_strnlen() prototype.

10 years agoAdd strndup() for those without it. As strndup.c uses strnlen(),
Todd C. Miller [Tue, 26 May 2015 20:05:26 +0000 (14:05 -0600)]
Add strndup() for those without it.  As strndup.c uses strnlen(),
use our own if it is missing.

10 years agoAdd missing sudo_ prefix and include sudo_compat.h.
Todd C. Miller [Tue, 26 May 2015 20:01:37 +0000 (14:01 -0600)]
Add missing sudo_ prefix and include sudo_compat.h.

10 years agoAdd strnlen() replacement needed for glob.c.
Todd C. Miller [Tue, 26 May 2015 19:55:18 +0000 (13:55 -0600)]
Add strnlen() replacement needed for glob.c.
Only used if no glob() and no strnlen().

10 years agoGet rid of SUDO_MAIN. Modern compilers don't warn about mixing
Todd C. Miller [Thu, 21 May 2015 17:26:44 +0000 (11:26 -0600)]
Get rid of SUDO_MAIN.  Modern compilers don't warn about mixing
extern and auto declarations unless they conflict.

10 years agoAvoid using a leading underbar in defines as they are reserved in
Todd C. Miller [Thu, 21 May 2015 17:13:20 +0000 (11:13 -0600)]
Avoid using a leading underbar in defines as they are reserved in
ISO C.

10 years agoAdd target for "make splint". A few files need extra guards to avoid
Todd C. Miller [Thu, 21 May 2015 17:07:13 +0000 (11:07 -0600)]
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.

10 years agoThere should be no need to check for tzset() as it is POSIX.
Todd C. Miller [Mon, 18 May 2015 19:42:06 +0000 (13:42 -0600)]
There should be no need to check for tzset() as it is POSIX.

10 years agoAdd sudo_reallocarrary to util.exp.in if reallocarray is not found.
Todd C. Miller [Mon, 18 May 2015 19:39:21 +0000 (13:39 -0600)]
Add sudo_reallocarrary to util.exp.in if reallocarray is not found.

10 years agoNLS now works on Mac OS X properly.
Todd C. Miller [Fri, 15 May 2015 21:50:00 +0000 (15:50 -0600)]
NLS now works on Mac OS X properly.

10 years agoForce flat namespace on darwin to make the getenv() hooking work
Todd C. Miller [Fri, 15 May 2015 21:48:24 +0000 (15:48 -0600)]
Force flat namespace on darwin to make the getenv() hooking work
as it does on ELF.

10 years agoNo need to cast malloc() return value.
Todd C. Miller [Thu, 14 May 2015 16:47:09 +0000 (10:47 -0600)]
No need to cast malloc() return value.

10 years agoUse reallocarray where possible.
Todd C. Miller [Thu, 14 May 2015 16:21:58 +0000 (10:21 -0600)]
Use reallocarray where possible.

10 years agoAdd reallocarray() for those without it.
Todd C. Miller [Thu, 14 May 2015 16:13:18 +0000 (10:13 -0600)]
Add reallocarray() for those without it.

10 years agoThe getenv() hook still doesn't work on Mac OS X.
Todd C. Miller [Wed, 13 May 2015 17:06:50 +0000 (11:06 -0600)]
The getenv() hook still doesn't work on Mac OS X.

10 years agoIn sudo_warn_gettext_v1() call dgettext() not gettext() to make
Todd C. Miller [Tue, 12 May 2015 21:58:05 +0000 (15:58 -0600)]
In sudo_warn_gettext_v1() call dgettext() not gettext() to make
sure the domain is set correctly.  The sudoers plugin uses its own
text domain.

10 years agoman pages should explicitly depend on config.status since it is
Todd C. Miller [Mon, 11 May 2015 23:01:41 +0000 (17:01 -0600)]
man pages should explicitly depend on config.status since it is
used to substitute in variables/settings.

10 years agoregen
Todd C. Miller [Mon, 11 May 2015 22:52:58 +0000 (16:52 -0600)]
regen

10 years agoSudo 1.8.14
Todd C. Miller [Mon, 11 May 2015 22:51:27 +0000 (16:51 -0600)]
Sudo 1.8.14

10 years agoInstead of trying to make weak functions work on all platforms,
Todd C. Miller [Mon, 11 May 2015 20:51:32 +0000 (14:51 -0600)]
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().

10 years agoFix indentation of -a flag help line.
Todd C. Miller [Mon, 11 May 2015 19:34:41 +0000 (13:34 -0600)]
Fix indentation of -a flag help line.

10 years agoFix compilation when HAVE_DECL_SIG2STR_MAX is not defined.
Todd C. Miller [Mon, 11 May 2015 19:26:16 +0000 (13:26 -0600)]
Fix compilation when HAVE_DECL_SIG2STR_MAX is not defined.

10 years agoAdd lint target to run "mandoc -Tlint" over the manuals.
Todd C. Miller [Mon, 11 May 2015 16:22:05 +0000 (10:22 -0600)]
Add lint target to run "mandoc -Tlint" over the manuals.

10 years agoHAVE_DECL_SIG2STR_MAX is always defined so use a !HAVE_DECL_SIG2STR_MAX
Todd C. Miller [Fri, 8 May 2015 23:31:31 +0000 (17:31 -0600)]
HAVE_DECL_SIG2STR_MAX is always defined so use a !HAVE_DECL_SIG2STR_MAX
check instead of #ifndef.

10 years agoSync tty_present() with sudoers version.
Todd C. Miller [Thu, 7 May 2015 17:20:49 +0000 (11:20 -0600)]
Sync tty_present() with sudoers version.

10 years agosudo_check_plugin() returns bool.
Todd C. Miller [Thu, 7 May 2015 17:05:05 +0000 (11:05 -0600)]
sudo_check_plugin() returns bool.

10 years agoIn usergr_matches() matched should be bool but we have to take care
Todd C. Miller [Thu, 7 May 2015 16:56:12 +0000 (10:56 -0600)]
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.

10 years agosudo_ldap_check_non_unix_group() returns bool, not int.
Todd C. Miller [Thu, 7 May 2015 16:43:26 +0000 (10:43 -0600)]
sudo_ldap_check_non_unix_group() returns bool, not int.

10 years agoConvert two debug_return_int to debug_return_bool.
Todd C. Miller [Thu, 7 May 2015 16:40:46 +0000 (10:40 -0600)]
Convert two debug_return_int to debug_return_bool.