Todd C. Miller
e9914a91b1
The sudoers plugin now defines its own list of debugging subsystem names
...
and defines.
2014-10-22 13:30:52 -06:00
Todd C. Miller
866cfc4fc3
Add support for multiple Debug lines per program. Callers may
...
register arbitrary debug facilities or use built-in defaults. We
now use separate Debug statements for plugins and programs.
2014-10-22 13:23:05 -06:00
Todd C. Miller
ecaecdc1f4
Merge secure_path.h -> sudo_util.h
2014-07-22 11:37:39 -06:00
Todd C. Miller
36a5767e3e
efree -> sudo_efree for consistency
2014-07-10 15:35:04 -06:00
Todd C. Miller
6217df4c19
regen
2014-06-27 14:56:27 -06:00
Todd C. Miller
aecef4aa1d
Rename warning/fatal -> sudo_warn/sudo_fatal to avoid namespace
...
pollution in libsudo_util.so.
2014-06-27 09:30:52 -06:00
Todd C. Miller
7bafa63c15
Don't pollute the namespace with lbuf struct and functions
2014-06-26 15:51:15 -06:00
Todd C. Miller
088edcb6f5
Add exported libsudo_util functions to util.exp and mark in headers
...
using __dso_public.
2014-06-26 15:51:15 -06:00
Todd C. Miller
a53946b026
Change return value of switch_dir() to an int so we can distinguish
...
between an error and an empty dir in push_includedir().
2014-05-02 07:57:29 -06:00
Todd C. Miller
480a94d07d
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.
2014-05-02 07:14:06 -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
b75bb6991f
Do not leak old istack if realloc fails; found by cppcheck.
...
Also modify yyless() to avoid a harmless cppcheck warning every
time it is used.
2014-01-13 09:52:41 -07:00
Todd C. Miller
b2c456341a
Move symbol extern defs into sudoers.h
2013-12-16 14:18:42 -07:00
Todd C. Miller
96eb2c4f8f
Add warning_gettext() wrapper function that changes to the user locale,
...
then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().
2013-11-18 08:59:57 -07:00
Todd C. Miller
a3aa40b0fe
Cope with a comment on the last line of the file with no newline.
...
Bug #623
2013-11-12 09:36:39 -07:00
Todd C. Miller
8e503a229f
Fix warnings from -Wold-style-definition
2013-11-04 06:26:37 -07:00
Todd C. Miller
07a804caf3
Quiet sign comparision warnings.
2013-10-23 15:03:31 -06:00
Todd C. Miller
f85106ea67
Use SLIST and STAILQ macros instead of doing headless singly linked
...
lists manually. As a bonus we now use a tail queue for ldap.c and
sudoreplay.c.
2013-10-22 09:08:09 -06:00
Todd C. Miller
d6282d154a
Update copyright years.
2013-04-24 09:35:02 -04:00
Todd C. Miller
26a256260d
Include stdint.h or inttypes.h before sha2.h
2013-04-16 12:16:41 -04:00
Todd C. Miller
e715841fc2
Sanity check digest in parser so visudo can catch errors.
...
Add base64 support
2013-04-15 15:12:00 -04:00
Todd C. Miller
35375a2b7e
Initial implementation of checksum support in sudoers.
...
Currently supports SHA-224, SHA-256, SHA-384, SHA-512.
TODO: checksum format validation in parser and base64 support.
checksum support for ldap sudoers
2013-04-14 07:00:21 -04:00
Todd C. Miller
c47f5f7abd
Fix potential double free in an error path.
2013-03-05 10:16:50 -05:00
Todd C. Miller
1d7072fe09
Don't include <sys/param.h>. We only needed it for MAXPATHLEN,
...
MAXHOSTNAMELEN and the MIN/MAX macros. We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
2012-12-04 10:40:47 -05:00
Todd C. Miller
7b3d268687
Call gettext() on parameters for warning()/warningx() instead of
...
having warning() do it for us.
2012-11-25 09:34:04 -05:00
Todd C. Miller
15c69e0e3f
Call gettext() in sudoerserror() in the user's locale and pass the untranslated string to it.
2012-11-25 09:33:58 -05:00
Todd C. Miller
595d3b2651
Display warning/error messages in the user's locale.
2012-11-08 15:37:44 -05:00
Todd C. Miller
1d90c0ad71
No need to translate "unable to allocate memory" when we can just
...
use the system translation via strerror().
2012-09-17 16:59:26 -04:00
Todd C. Miller
5276ab3a5f
Set yacc prefix to "sudoers" to avoid conflicts other yacc parsers.
2012-09-14 16:19:25 -04:00
Todd C. Miller
e498bab4c1
Don't print an error message in yyerror() if open_sudoers() fails,
...
we've already printed an error message. Also restore the check
for sudoers_warnings in yyerror().
2012-08-23 14:02:02 -04:00
Todd C. Miller
0c8c3c0cd8
Avoid printing the >>> parse error <<< message for testsudoers
...
when the -t flag is specified.
2012-08-23 11:28:44 -04:00
Todd C. Miller
b1d1d89899
Fix compilation on Solaris
2012-08-01 14:57:14 -04:00
Todd C. Miller
a9623c29c2
Fix SELinux build
2012-07-30 11:01:32 -04:00
Todd C. Miller
4abd2a6cf4
Merge in Solaris privilege support by Darren Moffat and John Zolnowsky
2012-07-26 13:49:21 -04:00
Todd C. Miller
8a7ac44590
Fix #includedir; from Mike Frysinger
2012-05-17 15:42:57 -04:00
Todd C. Miller
2c84bd4d08
Log warning() at SUDO_DEBUG_WARN not SUDO_DEBUG_ERROR.
...
Log the function, file and line number in the debug log for warning()
and error().
2012-04-05 12:37:15 -04:00
Todd C. Miller
aecb5206e2
Fix compiler warnings on some platforms and provide a better method
...
of defeating gcc's warn_unused_result attribute.
2012-03-29 10:33:40 -04:00
Todd C. Miller
b330cbbed8
We should always call warning() with a format string or a string literal.
...
In this case, the argument (path) is not user-controlled.
2012-03-15 08:47:23 -04:00
Todd C. Miller
8d05f0d1b0
Add type param to sudo_secure_path() and add sudo_secure_file()
...
and sudo_secure_dir() wrappers which get by #includedir in sudoers.
2012-02-29 15:50:48 -05:00
Todd C. Miller
21a2f95821
Use stdbool.h instead of rolling our own TRUE/FALSE macros.
2011-12-02 11:27:33 -05:00
Todd C. Miller
481877e3b8
Add support for relative paths in #include and #includedir
2011-11-17 20:48:42 -05:00
Todd C. Miller
ab437ae6c3
Add lexer tracing as debug@parser
2011-11-12 12:41:44 -05:00
Todd C. Miller
09beba8259
Revert 003bdb078a15. We need to #include <gram.h> not "gram.h" and
...
<def_data.h> and not "def_data.h" when generating the parser in a
build dir.
2011-11-12 12:18:44 -05:00
Todd C. Miller
0bf68d2103
#include "gram.h" not <gram.h> and "def_data.h" and not <def_data.h>.
2011-11-08 14:09:48 -05:00
Todd C. Miller
bd881c26e8
Keep track of the last token returned. On error, if the last token was
...
COMMENT, decrement sudolineno since the error most likely occurred on
the preceding line. Previously we always uses sudolineno-1 which will
give the wrong line number for errors within a line.
2011-11-05 07:37:14 -04:00
Todd C. Miller
839919566e
Add debug_decl/debug_return (almost) everywhere.
...
Remove old sudo_debug() and convert users to sudo_debug_printf().
2011-10-22 14:40:21 -04:00
Todd C. Miller
4f9a93f658
Fix some potential problems found by the clang static analyzer,
...
none serious.
2011-07-28 10:59:37 -04:00
Todd C. Miller
f6aea10724
Quiet compiler warning when SELinux is enabled.
2011-05-16 16:52:34 -04:00
Todd C. Miller
b643b190a7
Prepare sudoers module messages for translation.
2011-05-16 16:32:05 -04:00
Todd C. Miller
4dd3440cb6
Split ALL, ROLE and TYPE into their own actions. Since you can
...
only have #ifdefs inside of braces, ROLE and TYPE use a naughty
goto in the non-SELinux case. This is safe because the actions are
in one big switch() statement.
2011-04-29 16:05:50 -04:00